JS中最经典的全局变量和局部变量问题

话很少说,直接上例子:html 一、程序的运行结果为:100  10  100函数 1 var a = 10; 2 function test(){ 3 a = 100; 4 console.log(a); 5 console.log(this.a); 6 var a; 7 console.log(a); 8 } 9 test(); 解析:Javascrip
相关文章
相关标签/搜索