Ben thanks so much for taking the time and giving me the explanation. I have not had experience going through TC39. So I guess I will give it a try until they tell me to go away. On Thursday, October 9, 2025 at 9:51:32 AM UTC+5 [email protected] wrote:
> On Wed, Oct 8, 2025 at 9:06 PM Zeeshan Abid <[email protected]> wrote: > > > > Hello, I noticed that `toLower() === toLower()` is the common practice > for comparing strings ignoring case sensitivity. I wanted to know is it > possible to add a function like > > > > `String.compare(str1, str2, IgnoreLowerCaseOption);` > > > > This should in theory run faster than doing `toLower() === toLower()` > > > > I already tried using `String.prototype.localeCompare` and it is slower > than doing `toLower() === toLower()` > > > > Thanks! > > The answer to your question is both yes and no. > > Yes, in that it would be possible to implement that method in V8. > > No, in that V8 won't implement it until it's part of the ECMA > specification. Getting changes to the spec accepted means going > through TC39. I'd rather visit my local dentist; it's less painful and > over quicker. > > String.prototype.localeCompare computes equivalence, which is much > more complex and complicated than the case conversion that > String.prototype.toLowerCase performs. For example, localeCompare > considers "s\u0307\u0323" and "\u1E69" equivalent, whereas toLowerCase > does not. > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/v8-dev/3671268e-fe4a-4f7b-b529-47ce54629637n%40googlegroups.com.
