Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
1いいね 31回再生

javascript - What is the difference between "let" and "var"?

ECMAScript 6 introduced the let statement.
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.
What are the differences? When should let be used instead of var?
another Stack Overflow question: stackoverflow.com/questions/750486/javascript-clos…
hoisted and initialized: dev.to/godcrampy/the-secret-of-hoisting-in-javascr…
hoisted but not initialized: stackoverflow.com/questions/31219420/are-variables…
the temporal dead zone: stackoverflow.com/questions/33198849/what-is-the-t…

コメント