Checks if two values are equal, including support for Date, RegExp, and deep object comparison.
Date
RegExp
The first value to compare.
The second value to compare.
true if the values are equal, otherwise false.
true
false
isEqual(1, 1); // trueisEqual({ a: 1 }, { a: 1 }); // trueisEqual(/abc/g, /abc/g); // trueisEqual(new Date('2020-01-01'), new Date('2020-01-01')); // trueisEqual([1, 2, 3], [1, 2, 3]); // true Copy
isEqual(1, 1); // trueisEqual({ a: 1 }, { a: 1 }); // trueisEqual(/abc/g, /abc/g); // trueisEqual(new Date('2020-01-01'), new Date('2020-01-01')); // trueisEqual([1, 2, 3], [1, 2, 3]); // true
Alias