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

Published: 20 March 2024
on channel: Code Samples
31
1

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: https://stackoverflow.com/questions/7...
hoisted and initialized: https://dev.to/godcrampy/the-secret-o...
hoisted but not initialized: https://stackoverflow.com/questions/3...
the temporal dead zone: https://stackoverflow.com/questions/3...


Watch video javascript - What is the difference between "let" and "var"? online without registration, duration hours minute second in high quality. This video was added by user Code Samples 20 March 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 31 once and liked it 1 people.