JavaScript ToLowerCase

The JavaScript ToLowerCase method is used to convert the given string into Lowercase letters. The syntax of the ToLowerCase function in JavaScript programming language is

String_Object.ToLowerCase()

JavaScript ToLowerCase Example

The following set of to lowercase examples help you understand the ToLowerCase Function in JS.

<!DOCTYPE html>
<html>
<head>
    <title> JavaScript ToLowerCase </title>
</head>
<body>
    <h1> JavaScript ToLowerCase </h1>
<script>
 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);
</script>
</body>
</html>
JavaScript ToLowerCase

The following JavaScript statement converts the above Str1 string into lowercase.

var Str3 = Str1.toLowerCase();

Instead of declaring and assigning the string, JS allows us to use the ToLowerCase function on a string literal directly

 var Str4 = "Hi, This is FROM JS".toLowerCase();
 var Str5 = "JAVASCRIPT LOWERCASE".toLowerCase();