Computer >> Computer tutorials >  >> Programming >> Javascript

How to Convert a String to lowercase with JavaScript

Learn how to convert any text case to lower case with JavaScript.

To convert any string to lowercase you can use the JavaScript toLowerCase() method:

let someText = "Here is some text. Let us convert it all to lowercase"

someText.toLowerCase()

console.log(someText.toLowerCase())
// here is some text. let us convert it all to lowercase

toLowerCase() returns a new string, which means that it does not mutate (change) the original string.