在 JavaScript 中使用"let"和"var"来声明变量有什么区别?
ECMAScript 6 introduced the let
statement. I've heard it described as a "local" variable, but I'm still not quite sure how it behaves differently than the var
keyword.
What are the differences? When should let
be used over var
?
转载于:https://stackoverflow.com/questions/762011/whats-the-difference-between-using-let-and-var-to-declare-a-variable-in-jav
Lotus@
2009/04/17 20:09- var
- scope
- let
- javascript
- ecmascript
- 点赞
- 收藏
- 回答
满意答案
0个回复
