What is Scope in JavaScript?

preview_player
Показать описание
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:

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

kevinvz
Автор

Your video really helped me because I was confused with scopes. Thanks

bahramiwd
Автор

Now i could understand that tricks that had me confused since 2 year, thank u sir lam really happy to get this wonderful channel ❤

karimfawzy
Автор

you have earned my subscription. keep goin mate <3

agentprotik
Автор

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?

CiscoZero
Автор

Nice to hear a fellow Aussie making JS videos :)

TomDoesTech
Автор

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

thiagomeneses
Автор

Amazing, man! As a beginner, you've made things clearer for me to understand the concepts... Thank you!

emmanuelsaraiva
Автор

Bro what's your vs code color theme I like the colors of your code.

ghaziali
Автор

But why just not always use var ? so you can access it from everywhere?

thefsquad