Skip to content

isEqual

Subhajit Sahu edited this page Mar 17, 2020 · 23 revisions

Checks if two arrays are equal.

array.isEqual(x, y, [fn]);
// x:  an array
// y:  another array
// fn: compare function (a, b)
// --> true if equal
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

references

Clone this wiki locally