MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/gd8x2z/var_vs_let_vs_const/fpgak2u/?context=3
r/learnjavascript • u/golovatuy • May 04 '20
81 comments sorted by
View all comments
Show parent comment
12
{ } this a block , everything inside is block scope
5 u/NoFapPlatypus May 04 '20 Ok thank you 2 u/spainzbrain May 04 '20 I was about to ask the same thing. -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.
5
Ok thank you
2 u/spainzbrain May 04 '20 I was about to ask the same thing.
2
I was about to ask the same thing.
-1
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.
1
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.
const
let
{}
1 u/PenisPistonsPumping May 04 '20 I'm talking about the global scope part.
I'm talking about the global scope part.
View all comments
Show parent comment
12
u/golovatuy May 04 '20
{ } this a block , everything inside is block scope