freeCodeCamp's Global Scope and Functions, Understanding Local & Global Variables In JS (8)

Lesson Summary

Welcome to another Javascript tutorial video. We are continuing our journey through freeCodeCamp's Basic Javascript section. We are still in the Introduction to Javscript lessons and in this video we go over the following lessons: Global Scope and Functions, Local Scope and Functions, Global vs. Local Scope in Functions, Return a Value from a Function with Return, Understanding Undefined Value returned from a Function & Assignment with a Returned Value. The lessons we go through in todays video are regarding global and local scope of functions in Javascript. We find out that in Javascript if we define a variable inside of a function, then that function treats that variable as a local variable. If we have a variable by the same name outside of that function, the local variable will take precedence. We learn that a local variable can access a global variable, but a global variable cannot access a local variable in Javascript.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required