String.prototype.toLocaleLowerCase()
The toLocaleLowerCase()
method returns the calling string
value converted to lower case, according to any locale-specific case mappings.
Syntax
toLocaleLowerCase()
toLocaleLowerCase(locales)
Parameters
locales
optional- : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the
locales
argument, see Locale identification and negotiation.
- : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the
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 String.prototype.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.