JavaScript(JS) string method - tolowercase

‮i.www‬giftidea.com

The toLowerCase() method is a string method in JavaScript that is used to convert a string to lowercase letters.

Here is the syntax for the toLowerCase() method:

str.toLowerCase()

Here, str is the string you want to convert to lowercase.

The toLowerCase() method returns the str with all letters converted to lowercase.

Here is an example of using the toLowerCase() method:

let str = "HeLLo WorLD";
let result = str.toLowerCase();
console.log(result); // "hello world"

In the example above, the toLowerCase() method converts all uppercase letters in the str to lowercase, resulting in the string "hello world".

Note that the toLowerCase() method does not modify the original str. Instead, it returns a new string with all letters converted to lowercase.