isEqual - nodef/extra-iterable GitHub Wiki

Check if two iterables are equal.

Similar: compare, isEqual.

function isEqual(x, y, fc, fm)
// x:  an iterable
// y:  another iterable
// fc: compare function (a, b)
// fm: map function (v, i, x)
const xiterable = require('extra-iterable');

var x = [1, 2];
xiterable.isEqual(x, [1, 2]);
// → true

xiterable.isEqual(x, [11, 12]);
// → false

xiterable.isEqual(x, [11, 12], (a, b) => (a % 10) - (b % 10));
// → true

xiterable.isEqual(x, [11, 12], null, v => v % 10);
// → true

References