We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 用法一 for (let a = 1;a <=2; a++) { // 用法二 let c = 123; } console.log(a); console.log(c);
效果类似于在每轮循环内部嵌套了一层匿名函数
var a = []; for (let i = 0; i< 10; i++) { a[i] = function() { console.log(i); }; } a[6]();// 输出为6,而不是10;
{{{{{{let a=123}}}}}}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
let
let所解决的经典闭包问题
可以用任意多个块级作用域嵌套
{{{{{{let a=123}}}}}}
const
注意点
The text was updated successfully, but these errors were encountered: