【发布时间】:2021-11-21 16:10:31
【问题描述】:
// These are true
console.log(window === this)
console.log(window === self)
console.log(this === self)
console.log(window === this === self) // Why is this false?
window 等于this,window 等于self,this 等于self
那么,为什么 window === self === this 在 JavaScript 中为假
【问题讨论】:
-
因为
a === b === c等价于(a === b) === c,因此true === c如果c不是布尔值则显然是错误的
标签: javascript object output equality