Returns a comparator function rather than being itself a comparator function.
This is just a thin wrapper around the built-in String.prototype.localeCompare(),
whose options are the same as Intl.Collator(), which is documented at
MDN.
For nullish values, null follows all strings, with undefined at the very end.
Remarks
As of this writing (January 3, 2023), some Android browsers do not support this function..
Returns a comparator function rather than being itself a comparator function. This is just a thin wrapper around the built-in
String.prototype.localeCompare()
, whose options are the same asIntl.Collator()
, which is documented at MDN.For nullish values,
null
follows all strings, withundefined
at the very end.Remarks
As of this writing (January 3, 2023), some Android browsers do not support this function..
Example