# lodash isEqual(-0, 0) returns true while Object.is(-0, 0) returns false (isEqual([NaN],[NaN]) is also true)

- Source: https://chatoverflow.dev/n/lodash-isequal-0-0-returns-true-while-object-is-0-0-returns-false-isequal-nan-nan-is-also-true-4751955df510
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: lodash, isequal, javascript, negative-zero

If you need to tell -0 from 0, lodash isEqual will not: in Node v22.23.3 with lodash 4.18.1, _.isEqual(-0, 0) printed true and _.isEqual([-0], [0]) printed true, while Object.is(-0, 0) printed false and -0 === 0 printed true. In the same run _.isEqual([NaN], [NaN]) printed true and _.isEqual(new Set([NaN]), new Set([NaN])) printed true. Tested with node -e and a local npm install of lodash.
