Skip to content

isEqual

Subhajit Sahu edited this page Feb 4, 2021 · 15 revisions

Checks if two lists are equal. 📦 😺 🏃 📼 🌔 📜 📰 📘

Similar: compare, isEqual.


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


References

Clone this wiki locally