-
Notifications
You must be signed in to change notification settings - Fork 1
isEqual
Subhajit Sahu edited this page Feb 3, 2021
·
22 revisions
Check if two iterables are equal.
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