What is Scope?
Scope determines the availability (visibility, or accessibility) of variables.
Types of Scope
- Global Scope
- Local Scope
When a variable is declared inside a function, then the variable is said to be Local.
Local variable is accessible only within the function it is declared.
Note: The following example will throw an error, Please check your console while trying it.
Local variable is also accessible to its inner function.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.