How to convert a JavaScript String to lowercase

Caution: Audio may begin with Music!!

How to convert a JavaScript String to lowercase

JavaScript provides an in-built method to achieve the conversion via toLowerCase(). It will convert all the characters of a string to lowercase.

The method does not change the actual value, meaning, the returned string is a new string from the actual input.

const str = "HAPPY NEW YEAR 2021!";
console.log(str.toLowerCase());

OUTPUT

happy new year 2021!

Stop visitors from leaving your site!
Click to rate this post!
[Total: 6 Average: 5]
Shares

Recommended Articles

Leave a Reply

Pin It on Pinterest

Shares