A total order for all JavaScript values
npm install total-order:clown_face: total-order
==
A total order for all JavaScript values.
See docs.
> :warning: The code requires regeneratorRuntime to be defined, for instance by importing
> regenerator-runtime/runtime.
``js``
import totalOrder from 'total-order'
[
[1, 2, 3],
0,
undefined,
{x: 1},
new Date(1),
null,
{},
/abc/,
new Date(0),
'abc',
[],
NaN
].sort(totalOrder)
// [
// 0,
// NaN,
// null,
// [],
// [1, 2, 3],
// new Date(0),
// new Date(1),
// {},
// {x: 1},
// /abc/,
// 'abc',
// undefined,
// ]












