To convert a string to uppercase letters in JavaScript, use the toLocaleUpperCase() method.
Example
You can try to run the following code to learn how to work with toLocaleUpperCase() method in JavaScript −
<!DOCTYPE html> <html> <body> <script> var a = "amit"; document.write(a.toLocaleUpperCase()); </script> </body> </html>