The toUpperCase() Function is used to convert all the characters/letters of the String in upper case.
<html> <body> <script> var x = "HeLLo" var y = x.toUpperCase() document.write("The String in upper case is ",y) </script> </body> </html>
In the above code, we have declared a String HeLLo, in which the letters e and o are in lower case.
x = "HeLLo"
So, we have used the toUpperCase() Function to convert them to upper case and assign to a variable y.
y = x.toUpperCase()