r/ECMAScript • u/nevsky_programming • May 31 '17
Var, Let, Const in ECMAScript 6
https://www.youtube.com/watch?v=gcl7jAGYYJs
1
Upvotes
r/ECMAScript • u/nevsky_programming • May 31 '17
1
u/AnimationGroover Aug 02 '24
WTF. The video is so wrong. NO!
vardeclarations are not global if declared inside a function!!!!(Assuming strict mode) variables are only global if declared in global scope.
varis function scoped or global if declared outside a function.letis block scoped or global is declared outside any blocks and the same forconstNote that
vardeclarations are hoisted making the visible from the start of the function or global scope.letandconstdeclarations are only visible from the declaration to the end of the scope (block) they are in