使用“let”和“var”有什麼區別? - What's the difference between using “let” and “var”?

問題:

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”?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章