Returns true if the two arrays have the same length, and have the same items at the same indexes.
By default uses === semantics for equality checking.
Use isEqualIgnoreOrder if you don't care whether items are in same order.
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 instead:
// Eg. compare objects based on their 'name' propertyisEqual(a, b, v => v.name); Copy
// Eg. compare objects based on their 'name' propertyisEqual(a, b, v => v.name);
Function to compare values or produce a string key
If inputs are not arrays
Returns true if the two arrays have the same length, and have the same items at the same indexes.
By default uses === semantics for equality checking.
Use isEqualIgnoreOrder if you don't care whether items are in same order.
Compare by value instead: