String toLowerCase() method in JavaScript

You can use the toLowerCase() method in JavaScript for converting string to lower case.
You get the returned value in a new string.

Syntax:

str.toLowerCase();

Example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial- 
     scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>toLowerCase method</title>
    <script>
      var str = "JavaScript is awesome.";
      var newString = str.toLowerCase();
      document.write("NewString is: ", newString);
    </script>
  </head>
<body> 
</body>
</html>

Output:

NewString is: javascript is awesome.

Leave a Reply

Your email address will not be published. Required fields are marked *