Skip to content
Home ยป JS: toUpperCase() method

JS: toUpperCase() method

    The toUpperCase() method is member of class String. This function converts all the characters of a string into uppercase.

    Here is an example program with output:

    <!DOCTYPE html>
    <html>
    <head>
       <title>JavaScript:toUpperCase() method</title>
       <meta charset="utf-8">
    </head>
    <body>
    <script>
       var myName = "Raju";
    
    // convert to uppercase and display
    
       console.log(myName.toUpperCase());
    //Output = RAJU
    </script>
    </body>
    </html>

    Output of the Above Program

    RAJU