`
hite
  • 浏览: 52441 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

我看有错--Variables in JavaScript are fundamentally 。。

阅读更多
4.6. Variables as Properties
You may have noticed by now that there are a lot of similarities in JavaScript between variables and the properties of objects. They are both assigned the same way, they are used the same way in JavaScript expressions, and so on. Is there really any fundamental difference between the variable i and the property i of an object o? The answer is no. Variables in JavaScript are fundamentally the same as object properties. 



我认为作者整错了。起码

u.a = "1";
u = "1"

是不一样的。第二个u会成为全局的变量,而u.a不会
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics