ES6 变量挂起 ES6 全局 vs. 局部变量 ES6 算术运算符 ES6 变量挂起 var main = function() { for(var x = 0;x<5;x++) { console.log(x); } console.log("x can be accessed outside the block scope x value is :"+x); console.log('x is hoisted to the function scope'); } main(); ES6 全局 vs. 局部变量 ES6 算术运算符