Skip to content
Home ยป JS: toLowerCase() Method

JS: toLowerCase() Method

    In JavaScript programming, sometimes you wish to change the characters of a string to lowercase. You can do this with the help of <span style="color:#a30000" class="tadv-color">toLowerCase()</span> method of JavaScript class String.

    Here is the example program in which a string in uppercase is converted to lowercase using <span style="color:#a31800" class="tadv-color">toLowerCase() </span>method.

    <!DOCTYPE html>
    <html>
    <head>
       <title>JavaScrtipt:toLowerCase()</title>
       <meta charset="utf-8">
    </head>
    <body>
    <script>
      var name = "PETER PAN";
    //convert the name into a lowercase 
    
    console.log(name.toLowerCase();");//output = peter pan
    </script>
    </body>
    </html>

    Output of the above program

    peter pan