Prompt
Implement deepEqual(a, b) — structural equality:
- Primitives compare by value;
NaNequalsNaN(unlike===) - Arrays: same length, elements deep-equal in order
- Plain objects: same key set (an explicit
undefinedvalue still counts as a key), values deep-equal nullequals onlynull— remembertypeof null === 'object'- No JSON.stringify — it lies about key order, undefined, and NaN
Hints
Solution
Your Code
20 min