This method is used to convert the characters within a string to uppercase while respecting the current locale. For most languages, it returns the same output as toUpperCase.
Its syntax is as follows −
string.toLocaleUpperCase( )
Returns a string in uppercase with the current locale.
Try the following example.
<html> <head> <title>JavaScript String toLocaleUpperCase() Method</title> </head> <body> <script type="text/javascript"> var str = "Apples are round, and Apples are Juicy."; document.write(str.toLocaleUpperCase( )); </script> </body> </html>
APPLES ARE ROUND, AND APPLES ARE JUICY.