Character-case mapping (Overview)

Character case conversion.

The conversion of characters from upper to lower case and vice versa is accomplished in JavaScript by means of the String object. This provides two methods that can be applied to a String object to change its case. However, this would not work on String primitives so you may need to do an object conversion first.

The ECMAScript standard mandates that only the base characters need be mapped between the upper and lower case. Sorting and case conversion may support other international characters in some implementations, but this is not covered by the standard.

Localization issues may affect this sort of operation.

The interpreter should automatically convert any String primitives to String objects so that the method can be applied. This means that this should work:

"aaaa".toUpperCase()

And you should not need to do this:

String("aaaa").toUpperCase()

See also:ASCII, Character handling, Character set, Character testing, isLower(), isUpper(), Locale-specific behavior, String.charCodeAt(), String.fromCharCode(), String.toLocaleLowerCase(), String.toLocaleUpperCase(), String.toLowerCase(), String.toUpperCase(), Unicode