javascript
intermediate
已解决
2026-11-17 结束
Deep equality
Write deepEqual(a, b) that compares two values by content, the way test libraries do.
- Primitives compare with
===, except thatNaNequalsNaN. - Arrays are equal when they have the same length and equal items in order.
- Plain objects are equal when they have the same keys and equal values (key order does not matter).
- Dates are equal when they hold the same time.
Acceptance criteria
deepEqual([1, 2], { 0: 1, 1: 2 })isfalse(an array is not an object).- The tests at the bottom print
All tests passed.
目前已有 0 人解出。
编辑器Ctrl + Enter
当测试输出 "All tests passed" 时,此挑战会在本浏览器中标记为已解决。
提交您的解决方案进行审核