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 that NaN equals NaN.
  • 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 }) is false (an array is not an object).
  • The tests at the bottom print All tests passed.

अब तक 0 लोगों ने हल किया।

javascript
एडिटरCtrl + Enter

            
        

जब टेस्ट "All tests passed" दिखाते हैं, तो चैलेंज इस ब्राउज़र में हल के रूप में चिह्नित हो जाता है।

अपना समाधान समीक्षा के लिए भेजें