Returns true if the two arrays have the same items at same indexes. Use isEqualDefault to compare values regardless of position.
Returns false if arrays are of different length. By default uses === semantics for equality checking.
isEqual([ 1, 2, 3], [ 1, 2, 3 ]); // trueisEqual([ 1, 2, 3], [ 3, 2, 1 ]); // false Copy
isEqual([ 1, 2, 3], [ 1, 2, 3 ]); // trueisEqual([ 1, 2, 3], [ 3, 2, 1 ]); // false
Compare by value
isEqual(a, b, isEqualValueDefault); Copy
isEqual(a, b, isEqualValueDefault);
Custom compare, eg based on name field:
name
isEqual(a, b, (compareA, compareB) => compareA.name === compareB.name); Copy
isEqual(a, b, (compareA, compareB) => compareA.name === compareB.name);
Default comparer function is equiv to checking a === b. Use isEqualValueDefault to compare by value, via comparing JSON string representation.
a === b
Returns true if the two arrays have the same items at same indexes. Use isEqualDefault to compare values regardless of position.
Returns false if arrays are of different length. By default uses === semantics for equality checking.
Compare by value
Custom compare, eg based on
name
field: