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

Опубликовано: 20 Март 2024
на канале: 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...


Смотрите видео javascript - What is the difference between "let" and "var"? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Samples 20 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 31 раз и оно понравилось 1 людям.