What is toLowerCase () used for in JavaScript ?
The toLowerCase()
command in JavaScript is used to convert a string to lowercase letters. It’s a method that you can apply to a string, and it will return a new string with all the alphabetic characters converted to lowercase.
Example: Here, we have used toLowerCase()
to convert myString to lowercase.
Javascript
let myString = "Hello, World!" ; let lowercaseString = myString.toLowerCase(); console.log(lowercaseString); |
Output
hello, world!
Contact Us