-
Notifications
You must be signed in to change notification settings - Fork 0
isEqual
Subhajit Sahu edited this page Jun 18, 2020
·
15 revisions
Checks if two lists are equal. 🏃 📼 📦 🌔 📒
lists.isEqual(x, y, [fc], [fm]);
// x: lists
// y: another lists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const lists = require('extra-lists');
var x = [['a', 'b'], [1, 2]];
var y = [['a', 'b'], [1, 2]];
lists.isEqual(x, y);
// true
var y = [['a', 'b'], [11, 12]];
lists.isEqual(x, y);
// false
lists.isEqual(x, y, (a, b) => (a % 10) - (b % 10));
// true
lists.isEqual(x, y, null, v => v % 10);
// true