javascript的hoisting机制
摘要:
javascript解释器中存在一种变量声明被提升(hoisting)的机制,即变量(函数)的声明会被提升到作用域的最前面。即使把声明代码写在最后面。 alert(foo); //function foo(){} alert(bar); //undefined var bar = func... 阅读全文
posted @ 2014-05-11 11:45 思、慧 阅读(290) 评论(0) 推荐(0)