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