




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can check if a value is an array with the Array.isArray() method. You can check if a value is an object by saying typeof obj === 'object' && obj !== null. You can list the keys of an object with the Object.keys() function.
If two objects have different keys or two arrays have a different length, they cannot be equal.
You can use recursion to investigate if the values of an object or array are also deeply equal. The base case is when the values are primitives (string, number, etc), at which case the check is a trivial === check.