Deviopath › JavaScript

Deep Equal

Hard · Recursion

Write a function isDeepEqual that checks whether two JSON values are equal. Values can be null, numbers, strings, booleans, arrays and plain objects, nested in any way.

- Arrays are equal when they have the same length and equal items in the same order.

- Objects are equal when they have the same set of keys (in any order) with equal values.

- An array is never equal to an object, and null is only equal to null.

Next: All Subsets