Closed DevilRoshan closed 4 years ago
出自小程序前端面试星球
// 以下代码输出 var a = 0; if(true){ a = 10; console.log(a, window.a); function a(){} console.log(a, window.a); a = 20; console.log(a, window.a); } console.log(a)
https://github.com/DevilRoshan/Question/blob/master/20200806-js-code-scope.md