2 * A specialized version of `baseIsEqualDeep` for arrays with support for
3 * partial deep comparisons.
6 * @param {Array} array The array to compare.
7 * @param {Array} other The other array to compare.
8 * @param {Function} equalFunc The function to determine equivalents of values.
9 * @param {Function} [customizer] The function to customize comparing arrays.
10 * @param {boolean} [isLoose] Specify performing partial comparisons.
11 * @param {Array} [stackA] Tracks traversed `value` objects.
12 * @param {Array} [stackB] Tracks traversed `other` objects.
13 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
15 function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
17 arrLength = array.length,
18 othLength = other.length,
21 if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
24 // Deep compare the contents, ignoring non-numeric properties.
25 while (result && ++index < arrLength) {
26 var arrValue = array[index],
27 othValue = other[index];
32 ? customizer(othValue, arrValue, index)
33 : customizer(arrValue, othValue, index);
35 if (result === undefined) {
36 // Recursively compare arrays (susceptible to call stack limits).
38 var othIndex = othLength;
40 othValue = other[othIndex];
41 result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
47 result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
54 module.exports = equalArrays;