VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-string-tolocaleuppercase-method/

⇱ JavaScript String toLocaleUpperCase() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript String toLocaleUpperCase() Method

Last Updated : 12 Jul, 2025

The String.prototype.toLocaleUpperCase() method in JavaScript is a Standard built-in object which returns the calling string value converted to the uppercase letter on the basis of the host's current locale. This method mostly returns a similar result as the string toUppercase() method

Syntax:

str.toLocaleUpperCase()
str.toLocaleUpperCase(locale)

Parameters:

  • locale: It is an optional parameter and this locale parameter indicates the locale to be used to convert to upper case according to any locale-specific case mappings.

Returns Value:

This method returns a string of uppercase letters. 

Exceptions:

This method gives two kinds of errors, which are as follows:

  • RangeError: If the locale argument isn't a valid language tag.
  • TypeError: If an array element isn't of type string.

Example 1: In this example, we will convert some lowercase strings into uppercase letters using the String.prototype.toLocaleUpperCase() method in JavaScript.


Output
EN-US: GEEKSFORGEEKS
TR: GEEKSFORGEEKS
Result: STRING.PROTOTYPE.TOLOCALEUPPERCASE()

Example 2: In this example, we will convert some lowercase strings into uppercase letters using the String.prototype.toLocaleUpperCase() method in JavaScript.


Output
ALPHABET
false
true
true

Supported Browsers:

The browsers supported by the String.prototype.toLocaleUpperCase() method are listed below:

  • Google Chrome 41
  • Edge 12
  • Firefox 29
  • Opera 28
  • Safari 10
Comment