Last updated on February 20, 2023
In JavaScript, the toLowerCase() method converts the string into lowercase. It doesn’t accept any parameter and can be accessed through dot notation.
Syntax
anyTextOrString.toLowerCase()
Parameter
It doesn’t accept any parameter.
Example 1
Create a string that should contain an uppercase value.
"BLACK"
Next, attach the toLowerCase() method to convert it into lowercase.
"BLACK".toLowerCase();
// Output: black
In this example, the toLowerCase() method is attached to the string that converts the value into lowercase.
To print the converted value in the console, you can use the console.log() function.
console.log("BLACK".toLowerCase());