JavaScript toLowerCase()
The toLowerCase()
method in JavaScript is used to convert a string to lowercase letters. It returns the new string with all the letters in the original string converted to lowercase.
Syntax
The syntax for using the toLowerCase()
method is as follows:
string.toLowerCase()
Here, string
is the string that you want to convert to lowercase.
Example
Consider the following example:
let message = "Welcome to JavaScript World!";
let lowerCaseMessage = message.toLowerCase();
console.log(lowerCaseMessage);
The output of the above code will be:
welcome to javascript world!