24 lines
367 B
JavaScript
24 lines
367 B
JavaScript
export function isEqualArrays(arrA, arrB) {
|
|
if (arrA === arrB) {
|
|
return true;
|
|
}
|
|
|
|
if (!arrA || !arrB) {
|
|
return false;
|
|
}
|
|
|
|
var len = arrA.length;
|
|
|
|
if (arrB.length !== len) {
|
|
return false;
|
|
} // eslint-disable-next-line no-plusplus
|
|
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
if (arrA[i] !== arrB[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
} |