{}[true]是[true]和![true]应该的false.
{}[true]
[true]
![true]
false
那么为什么 !{}[true]评价true呢?
!{}[true]
true
javascript
调用构造函数a时,'a'的值似乎失去了全局范围.
var a = 6; function b() { a = 10; function a() {} console.log(a); //10 } b(); console.log(a); //6
javascript scope hoisting
javascript ×2
hoisting ×1
scope ×1