Thanks to visit codestin.com
Credit goes to codesweetly.com

Skip to content
Your Complete React Roadmap: From JSX to Deployment

toLowerCase() in JavaScript – How to Convert String to Lowercase

Whenever you use toLowerCase() on a string, the method does the following:

  1. It converts its calling string to lowercase.
  2. It returns the new version of the calling string—without changing the original string.

String toLowerCase() method's
tidbit

Use the toLowerCase() method to convert your string to lowercase.

toLowerCase() does not accept any argument. Here is the syntax:

callingString.toLowerCase();

Example 1: Convert CodeSweetly to Lowercase

Section titled “Example 1: Convert CodeSweetly to Lowercase”
"CodeSweetly".toLowerCase();
// The invocation above will return: "codesweetly"

Try Editing It

Example 2: Convert a JavaScript String to Lowercase

Section titled “Example 2: Convert a JavaScript String to Lowercase”
"FRIDAY, MY FRIEND, WAS BORN ON FRIDAY".toLowerCase();
// The invocation above will return: "friday, my friend, was born on friday"

Try Editing It