Open In App

How to Convert a String to Lowercase in JavaScript ?

Last Updated : 29 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

To convert a string to lowercase in JavaScript, you can use the toLowerCase() method. This method does exactly what it sounds like – it transforms all the characters in a string to lowercase.

Example: Here, toLowerCase() is applied to the myString variable, and the result is stored in the lowercaseString variable. After this operation, lowercaseString will contain the string “hello, world!”.

Javascript




let myString = "Hello, World!";
let lowercaseString = myString.toLowerCase();
 
console.log(lowercaseString);


Output

hello, world!


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads