COMPARE - nodef/extra-function GitHub Wiki

Compare two values.

Similar: ARGUMENTS, NOOP, IDENTITY, COMPARE.

function COMPARE(a, b)
// a: a value
// b: another value
const xfunction = require('extra-function');


xfunction.COMPARE(1, 2);
// → -1

xfunction.COMPARE(2, 2);
// → 0

xfunction.COMPARE(3, 2);
// → 1

xfunction.COMPARE('a', 'b');
// → -1