s.toUpperCase() → return a string of upper case version of string s.
console.log ( "abc".toUpperCase() === "ABC" ); // true // works on Greek or any unicode that has upper/lower case defined console.log ( "αβχ".toUpperCase() === "ΑΒΧ" ); // true
s.toLowerCase() → return a string of lower case version of string s.
console.log ( "ABC".toLowerCase() === "abc" ); // true console.log ( "ΑΒΧ".toLowerCase() === "αβχ" ); // true
s.toLocaleUpperCase() → same as
Here's quote from spec:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the toLocaleUpperCase method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the toLocaleUpperCase method is used.
This function interprets a String value as a sequence of UTF-16 encoded code points, as described in 6.1.4.
This function works exactly the same as toUpperCase except that its result is intended to yield the correct result for the host environment’s current locale, rather than a locale-independent result. There will only be a difference in the few cases (such as Turkish) where the rules for that language conflict with the regular Unicode case mappings.
If you have a question, put $5 at patreon and message me.