Global VS Local Variables

Published: 16 February 2021
on channel: Vicky Mei
1,117
57

global vs local variables in javascript #youtubeshorts #SHORTS

global and local variables in #javascript
.
.
Let’s compare them with groceries 😂🤣 seems like you all really enjoy my silly food examples. Well ima make more of that. I love comparing everything with food anyways 😂😂
.
➡️Global variables are declared outside any function, and they can be accessed (used) on any function in the program.
➡️compare that like your mamas groceries. Everyone in the family can grab it. It’s almost like a first come first serve 😅😅😅
➡️Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.
➡️compare that to your own groceries in the fridge. It’s yours and no one supposedly should take them from you 😂😂😂👏🏼🙌🏽 well unless you love to share 😝😛

#learntocode #programming #webdevelopment


Watch video Global VS Local Variables online without registration, duration hours minute second in high quality. This video was added by user Vicky Mei 16 February 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,117 once and liked it 57 people.