Skip to content

COMPARE

Subhajit Sahu edited this page Jul 22, 2022 · 2 revisions

Compare two values.

Similar: ARGUMENTS, NOOP, IDENTITY, COMPARE.


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


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

COMPARE(2, 2);
// → 0

COMPARE(3, 2);
// → 1

COMPARE('a', 'b');
// → -1
Clone this wiki locally