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

前端 未结 6 1739
时光说笑
时光说笑 2020-12-03 17:32

I am working on a part of the code where I have an array which looks like [[data]]. The data is rendered on the server side through the Django temp

6条回答
  •  执念已碎
    2020-12-03 18:31

    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.

提交回复
热议问题