15.5.4.16 String.prototype.toLowercase()

2010-07-11

string String.prototype.toLowercase()

Convert all uppercase letters in this value to a lowercase value and return a new string.

The this value is coerced to string.

Note that certain (exotic) characters map to multiple characters. Therefore the result string MAY NOT be of equal length.

The toLowerCase and toUpperCase functions are not symmetrical (partially due to the previous note) so "hello".toLowerCase() may not be the same as "hello".toLowerCase().toUpperCase.toLowerCase(), if "hello" contains certain characters.

Code: (Meta Ecma)
String.prototype.toLowercase() = function(){
CheckObjectCoercible(this);
var S = ToString(this);
// replace all unicode uppercase characters by unicode lowercase characters
// or "the actual corresponding characters of S" if no quivalent unicode
// character exists.
var L = S.toLowerCase();
return L;
}