I would be a fan of adding a `string.compare(other, {ignoreCase = false, unicode = false})` that purely works by character code/code point and is required to return 1, 0, or -1. That would be easier to spec, and is more generally useful when you're working with strings for computers, not people.
But that's largely independent of this proposal. ----- Isiah Meadows m...@isiahmeadows.com www.isiahmeadows.com On Wed, Jun 27, 2018 at 11:37 AM, Robert Wozniak <wozniakj.rob...@gmail.com> wrote: > Hi, > > > > I think you’re right, It could be simpler to do it like that. > > > > I have checked “localeCompare”, it does compare case sensitive strings but > it doesn’t compare strings in an array and to do it, you will have to > execute the method as many times as strings in an array. By using > ignoreCase method, you will pass specific array and the method will do it > for you inside. Second thing, “localeCompare” returns numbers: 0, 1, -1, -2 > depends on the result, a method proposed by me returns true or false. > > > > Another thing would be that “localeCompare” is heavier that ignoreCase > method. I think we should have lightweight alternative to compare case > sensitive strings. > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss