DEV Community

Cover image for Coding Interview Problem: checking if two things are equal
David Armendáriz
David Armendáriz

Posted on

Coding Interview Problem: checking if two things are equal

It is pretty straightforward to check if two values are equal right? Just compare them!

value1 === value2
Enter fullscreen mode Exit fullscreen mode

But what if value1 and value2 are two objects? What if they have nested properties? What if these properties are arrays? Well, then you must use recursion right?

I once got asked this problem in a Coding Interview Problem and wanted to share my solution.

Top comments (0)