Open In App

What is toLowerCase() Method in JavaScript ?

Last Updated : 12 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Javascript str.toLowerCase() method converts the entire string to lowercase. This method does not affect any of the special characters, digits, and the alphabet that is already in lowercase.

Syntax:

str.toLowerCase();

Example: Here, the toLowerCase() method is called on the str string, converting all uppercase letters to lowercase. The resulting string, "hello world", is assigned to the variable lowerStr.

Javascript




const str = "HELLO WORLD";
const lowerStr = str.toLowerCase();
 
console.log(lowerStr); // Output: "hello world"


Output

hello world

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads