Test name | Executions per second |
---|---|
localeCompare() | 167561.0 Ops/sec |
Intl.Collator.compare() | 3211336.0 Ops/sec |
var a = "FOO BAR";
var b = "foo bar";
var options = {
sensitivity: 'base'
};
var collator = new Intl.Collator(undefined, options);
a.localeCompare(b, undefined, options) === 0
collator.compare(a, b) === 0