var let const in Javascript Scope | Understanding Global Local Function Block Scope

Publicado em: 08 Setembro 2020
no canal de: Dave Gray
17,164
653

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

In this video we'll compare the keywords var, let, and const in JavaScript which also requires an understanding of JavaScript scopes such as global scope, local scope, function scope, and block scope.

▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here:    • Javascript Tutorials for Beginners  

✅ Quick Concepts outline:
var, let, and const in Javascript
(00:00) Intro
(0:30) What makes var different
(1:40) What makes let different
(2:05) What makes const different
(2:35) A discussion of scope
(2:50) Global Scope
(3:25) Local Scope
(3:35) Block Scope
(4:00) Function Scope
(4:45) Local Scope variables declared with let or const are not available in global scope
(6:00) Nested block scope inside of a function
(7:05) Global scope variables are available in local scopes
(8:00) Global scope is available to all scopes
(8:25) If statements have block scopes
(8:35) for loops have block scopes
(8:45) switch statements have block scopes
(9:00) Review of scopes so far...
(9:50) A 2nd Example of global, function, and block scopes
(14:40) Note: var is function scoped; const & let are block scoped
(15:45) Review with helpful graphic :)

📚 Further Reading:
MDN Web Docs:
Scope: https://developer.mozilla.org/en-US/d...
Global Scope: https://developer.mozilla.org/en-US/d...
Local Scope: https://developer.mozilla.org/en-US/d...
Eloquent JavaScript Chapter 3:
https://eloquentjavascript.net/03_fun...

📺 More Beginner JS Videos:
freeCodeCamp:    • Learn JavaScript - Full Course for Be...  
Traversy Media:    • JavaScript Crash Course For Beginners  
The Net Ninja:    • Modern JavaScript Tutorial #1 - Intro...  

✅ Follow Me:
Twitter:   / yesdavidgray  
Reddit:   / daveoneleven  
Medium:   / davegray_86804  

#var #let #const


Nesta página do site você pode assistir ao vídeo on-line var let const in Javascript Scope | Understanding Global Local Function Block Scope duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Dave Gray 08 Setembro 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 17,164 vezes e gostou 653 espectadores. Boa visualização!