問題:
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”?