Skip to content

isEqual

Subhajit Sahu edited this page Dec 28, 2022 · 15 revisions

Check if two lists are equal.

Similar: compare, isEqual.


function isEqual(x, y, fc, fm)
// x:  lists
// y:  another lists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xlists = require('extra-lists');

var x = [['a', 'b'], [1, 2]];
var y = [['a', 'b'], [1, 2]];
xlists.isEqual(x, y);
// → true

var y = [['a', 'b'], [11, 12]];
xlists.isEqual(x, y);
// → false

xlists.isEqual(x, y, (a, b) => (a % 10) - (b % 10));
// → true

xlists.isEqual(x, y, null, v => v % 10);
// → true


References

Clone this wiki locally