Test name | Executions per second |
---|---|
localeCompare() | 155390.6 Ops/sec |
Intl.Collator.compare() | 2576713.8 Ops/sec |
var a = "z11";
var b = "z1";
var options = {
sensitivity: 'base',
numeric: true,
};
var collator = new Intl.Collator(undefined, options);
a.localeCompare(b, undefined, options) === 1
collator.compare(a, b) === 1