You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
318 B
JavaScript
8 lines
318 B
JavaScript
export function areArraysEqual(array1, array2) {
|
|
var itemComparer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (a, b) {
|
|
return a === b;
|
|
};
|
|
return array1.length === array2.length && array1.every(function (value, index) {
|
|
return itemComparer(value, array2[index]);
|
|
});
|
|
} |