On Wed, Jun 27, 2018 at 4:37 PM, Robert Wozniak <wozniakj.rob...@gmail.com> wrote: > ...Second thing, “localeCompare” returns numbers: 0, 1, -1, -2 depends > on the result, a method proposed by me returns true or false.
This makes your method markedly less useful than `localeCompare`. It's really useful to know not just that the strings are equal or not equal, but how they relate to one another lexicographically. For instance, for sorting: ```js const array = ["c", "a", "B"]; array.sort((a, b) => a.localeCompare(b, undefined, {sensitivity: "base"})); console.log(array); // "a", "B", "c" ``` -- T.J. Crowder
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss