问题:
ECMAScript 6 introduced the let
statement . ECMAScript 6 引入了let
语句。
I've heard that it's described as a local
variable, but I'm still not quite sure how it behaves differently than the var
keyword.我听说它被描述为local
变量,但我仍然不太确定它与var
关键字的行为有何不同。
What are the differences?.有什么区别?。 When should let
be used instead of var
?什么时候应该使用let
而不是var
?
解决方案:
参考一: https://stackoom.com/question/3CEV参考二: What's the difference between using “let” and “var”?