JavaScript toLowerCase

The JavaScript toLowerCase method converts the given string into Lowercase letters. The syntax of the toLowerCase function is


JavaScript toLowerCase Example

The following set of examples helps you understand the toLowerCase Function.

The second JavaScript statement, Str3, converts the above-declared Str1 string into lowercase.

Instead of declaring and assigning the string, we can also use the function on a string literal directly. The folding two lines for Str4 and Str5 use the same.

<!DOCTYPE html>
    <title> JavaScriptToLowerCase </title>
    <h1> JavaScriptToLowerCase </h1>
 var Str1 = "Learn JavaScript at Tutorial Gateway";
 var Str3 = Str1.toLowerCase();
 var Str4 = "Hi, This is FROM JS".toLowerCase();
 var Str5 = "JAVASCRIPT LOWERCASE".toLowerCase();

 document.write("<b> Lowercase Letters are:</b> " + Str3);
 document.write("<br \> <b> Lowercase Letters are: </b> " + Str4);
 document.write("<br \> <b> Lowercase Letters are: </b> " + Str5);
JavaScript ToLowerCase Example