You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
330 B
17 lines
330 B
|
2 years ago
|
'use strict';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Tests if two arrays are equal.
|
||
|
|
*
|
||
|
|
* @param {unknown} a
|
||
|
|
* @param {unknown} b
|
||
|
|
* @returns {boolean}
|
||
|
|
*/
|
||
|
|
module.exports = function arrayEqual(a, b) {
|
||
|
|
if (!Array.isArray(a) || !Array.isArray(b)) return false;
|
||
|
|
|
||
|
|
if (a.length !== b.length) return false;
|
||
|
|
|
||
|
|
return a.every((elem, index) => elem === b[index]);
|
||
|
|
};
|