浅谈Javascript中的with、eval与做用域

[b]javascript的做用域是词法做用域(lexical scope or static scope),也就是说做用域链在定义的时候就肯定了。也提到eval、with会扰乱做用域链(dynamic scope)。[/b] [b]with [/b] �功能应用。 with会暂时修改做用域链。 <script> function a(){ with (b) { ... } }a(); </scr
相关文章
相关标签/搜索