+ 1

So where can "let" be used instead of "var" in JS?

28th Jul 2020, 4:33 PM
Iloka Nadia
Iloka Nadia - avatar
4 ответов
28th Jul 2020, 4:36 PM
Roopesh
Roopesh - avatar
+ 2
Everywhere. You can use let everywhere in your code. Use const only if confirmed about that variable will not be changed in entire scope.
28th Jul 2020, 4:36 PM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
+ 2
Just to be sure you should read about variable hoisting
28th Jul 2020, 4:36 PM
Dragonxiv
Dragonxiv - avatar
+ 1
Thanks guys
28th Jul 2020, 4:40 PM
Iloka Nadia
Iloka Nadia - avatar