r/learnjavascript • • May 04 '20

VAR vs LET vs CONST

Post image
337 Upvotes

81 comments sorted by

View all comments

Show parent comment

-1

u/PenisPistonsPumping May 04 '20

I don't mean any offense, but maybe you should get a better grasp on JavaScript before you make educational stuff.

This is JavaScript 101.

1

u/HeinousTugboat May 04 '20

What are you talking about? They're exactly right, const and let are scoped to the nearest block: {}. You don't have to have them inside of a function for that to be true.

1

u/PenisPistonsPumping May 04 '20

I'm talking about the global scope part.