The toLocaleLowerCase()
method returns the calling string value converted to lower case, according to any locale-specific case mappings.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
str.toLocaleLowerCase() str.toLocaleLowerCase(locale) str.toLocaleLowerCase([locale, locale, ...])
Parameters
locale
Optional- The
locale
parameter indicates the locale to be used to convert to lower case according to any locale-specific case mappings. If multiple locales are given in anArray
, the best available locale is used. The default locale is the host environmentโs current locale.
Return value
A new string representing the calling string converted to lower case, according to any locale-specific case mappings.
Exceptions
- A
RangeError
("invalid language tag: xx_yy") is thrown if alocale
argument isn't a valid language tag. - A
TypeError
("invalid element in locales argument") is thrown if an array element isn't of type string.
Description
The toLocaleLowerCase()
method returns the value of the string converted to lower case according to any locale-specific case mappings. toLocaleLowerCase()
does not affect the value of the string itself. In most cases, this will produce the same result as toLowerCase()
, but for some locales, such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may be a different result.
Examples
Using toLocaleLowerCase()
'ALPHABET'.toLocaleLowerCase(); // 'alphabet' '\u0130'.toLocaleLowerCase('tr') === 'i'; // true '\u0130'.toLocaleLowerCase('en-US') === 'i'; // false let locales = ['tr', 'TR', 'tr-TR', 'tr-u-co-search', 'tr-x-turkish']; '\u0130'.toLocaleLowerCase(locales) === 'i'; // true
Specifications
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toLocaleLowerCase | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 5.5 | Opera Full support 4 | Safari Full support 1.3 | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 | nodejs Full support 0.1.100 |
locale | Chrome Full support 58 | Edge Full support 12 | Firefox Full support 55 | IE Full support 6 | Opera Full support 45 | Safari Full support 10 | WebView Android Full support 58 | Chrome Android Full support 58 | Firefox Android Full support 55 | Opera Android Full support 43 | Safari iOS Full support 10 | Samsung Internet Android Full support 7.0 | nodejs
Full support
13.0.0
|
Legend
- Full support
- Full support
- See implementation notes.
- See implementation notes.