0

I want to know how top.location and self.location is compared. I mean on what basis are they compared?

Are they compared using their memory address or their references or something else? Basically, i want to know when (top.location == self.location) will give true and when the comparison will give false?

I know all those stuff that says they are compared using their respective url and all that. But the thing is they are objects. And hence, it would be interesting to know how objects are compared?

4

1 回答 1

0

在 Javascrpt iirc 中通过引用复制、传递和比较对象、数组和函数。所以top === self当他们引用同一个对象时。从中可以清楚地看出, 的相等性也top.location === self.location必须成立。

参考

于 2013-10-02T20:35:50.760 回答