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.
27 lines
378 B
27 lines
378 B
'use strict';
|
|
|
|
function shallowEqualArrays(arrA, arrB) {
|
|
if (arrA === arrB) {
|
|
return true;
|
|
}
|
|
|
|
if (!arrA || !arrB) {
|
|
return false;
|
|
}
|
|
|
|
var len = arrA.length;
|
|
|
|
if (arrB.length !== len) {
|
|
return false;
|
|
}
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
if (arrA[i] !== arrB[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
module.exports = shallowEqualArrays;
|
|
|