Test name | Executions per second |
---|---|
localeCompare() | 200245.5 Ops/sec |
Intl.Collator.compare() | 3834686.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