84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
function ppp(){ var a = 2; sss = function(){ console.log(a); } } ppp(); sss();
这里能打印2感觉很神奇,因为2在ppp函数作用域里面,sss在外面执行竟然能拿到值
A question about js? -PHP Chinese website Q&A-A question about js? -PHP Chinese website Q&A
Let’s take a look and learn.
你的理解完全错了, 首先 你这样 直接写 a =2; 实际相当于 声明了个全局变量 ,你可以理解为 window.a =2;当然能拿到。
A question about js? -PHP Chinese website Q&A-A question about js? -PHP Chinese website Q&A
Let’s take a look and learn.
你的理解完全错了, 首先 你这样 直接写 a =2; 实际相当于 声明了个全局变量 ,你可以理解为 window.a =2;当然能拿到。