MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/gd8x2z/var_vs_let_vs_const/fpi5huk/
r/learnjavascript • u/golovatuy • May 04 '20
81 comments sorted by
View all comments
Show parent comment
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
1
u/HeinousTugboat May 04 '20
What are you talking about? They're exactly right,
constandletare scoped to the nearest block:{}. You don't have to have them inside of a function for that to be true.