7 Tweets Apr 18, 2023
Here is a detailed explanation of what “Scope” are in JavaScript 💡
1. Block scope
— Variables declared through let and const inside a {} block can only be accessed inside this block.
2. Function scope
— A function scope variables can only be accessed inside the function.
3. Global scope
— A variable declared in global namespace becomes a global variable.
— Using all three scopes
In a program, we often use all three scopes together.
You can get my free JavaScript e-book that has 100+ free resources.
🔗 haiderkh1.gumroad.com
That's a wrap!
If you enjoyed this thread:
1. Follow me @slow_developer for more of these
2. RT the tweet below to share this thread with your audience

Loading suggestions...