Why [] == [] is false in JavaScript?

Because == (and ===) test to see if two objects are the same object and not if they are identical objects.

Most test frameworks will include functions such as deepEqual if you want to see if two objects are identical.

Leave a Comment