-
Notifications
You must be signed in to change notification settings - Fork 0
isEqual
Subhajit Sahu edited this page Dec 28, 2022
·
15 revisions
Check if two ilists are equal.
function isEqual(x, y, fc, fm)
// x: ilists
// y: another ilists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xilists = require('extra-ilists');
var x = [['a', 'b'], [1, 2]];
var y = [['a', 'b'], [1, 2]];
xilists.isEqual(x, y);
// → true
var y = [['a', 'b'], [11, 12]];
xilists.isEqual(x, y);
// → false
xilists.isEqual(x, y, (a, b) => (a % 10) - (b % 10));
// → true
xilists.isEqual(x, y, null, v => v % 10);
// → true