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