What is Scope in JavaScript?
HTML-код
- Опубликовано: 13 июл 2024
- In today's video I'll be explaining the 3 different types of scopes in JavaScript: global scope, function scope and block scope. If you're new to JavaScript or don't understand scopes, it's super important to make sure you're across this concept.
Chapters:
0:00 Intro
0:44 Global Scope
3:46 Function Scope
5:47 Block Scope
9:07 Outro
For your reference, check this out:
developer.mozilla.org/en-US/d...
🏫 My Udemy Courses - www.udemy.com/user/domenic-co...
🎨 Download my VS Code theme - marketplace.visualstudio.com/...
💜 Join my Discord Server - / discord
🐦 Find me on Twitter - / dcodeyt
💸 Support me on Patreon - / dcode
📰 Follow me on DEV Community - dev.to/dcodeyt
📹 Join this channel to get access to perks - / @dcode-software
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
#dcode #javascript
Never realized var escaped block scopes, awesome video as always
Another good one Dom thanks!!
Perfectly Explained !!
Your video really helped me because I was confused with scopes. Thanks
you have earned my subscription. keep goin mate
Very useful! new sub
Now i could understand that tricks that had me confused since 2 year , thank u sir lam really happy to get this wonderful channel ❤
Amazing lesson! I'm so far ahead learning syntax and methods, but I had no idea about scopes. Why hadn't I learned this very basic concept in coding?
Thank you for your video! However I still have some questions, in the start of the video you mentioned that variables assigned with let and const can still be global variables, however they cannot be found in the window object, but when trying this out in my computer this did not happen, even variables defined with these keywords were shown in my object. Also, I was able to use them like this: window.varName. Both when using let and also const
Amazing, man! As a beginner, you've made things clearer for me to understand the concepts... Thank you!
Nice to hear a fellow Aussie making JS videos :)
Bro what's your vs code color theme I like the colors of your code.
I'm using the "dcode" theme.
@@dcode-software thanks dude
But why just not always use var ? so you can access it from everywhere?
Sometime can be chaotic
var is also having hoisting issue, makes bad readability and understanding
Using too much var for a global scope also makes the browser load slow it takes up more memory.
could not explain