Skip to content

isEqual

Subhajit Sahu edited this page May 19, 2020 · 22 revisions

Checks if two iterables are equal. 🏃 📼 📦 🌔 📒

Similar: [compare], [isEqual].

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

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

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

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

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

references

Clone this wiki locally