-
Notifications
You must be signed in to change notification settings - Fork 5
isEqual
Subhajit Sahu edited this page May 19, 2020
·
23 revisions
Checks if two arrays are equal. 🏃 📼 📦 🌔 📒
array.isEqual(x, y, [fc], [fm]);
// x: an array
// y: another array
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require('extra-array');
var x = [1, 2];
array.isEqual(x, [1, 2]);
// true
array.isEqual(x, [11, 12]);
// false
array.isEqual(x, [11, 12], (a, b) => (a % 10) - (b % 10));
// true
array.isEqual(x, [11, 12], null, v => v % 10);
// true