epoberezkin / fast-deep-equal

The fastest deep equality check with Date, RegExp and ES6 Map, Set and typed arrays support
MIT License
1.86k stars 101 forks source link

Bug: invalid dates are not equal #138

Open Semigradsky opened 1 year ago

Semigradsky commented 1 year ago
const deepEqual = require('fast-deep-equal')

deepEqual(
    new Date('foo'),
    new Date('bar'),
)   // false

I expect that invalid dates will be equal, the same as invalid numbers (NaN).

In lodash/underscore:

_.isEqual(new Date('foo'), new Date('bar')) // true