JavaScript (JS) is a growing language, but most developers are clear with the variable scope rules. Every programming language has variables that are accessed within a certain scope, but is a lot more trickier on JS. At first glance, it may look simple but can go wrong if the JS variables are not scoped properly.
The article teaches on the scope found in JS in detail along with how to mix both Global and Functional Scopes. Remember that a scope in JS is declared when you define a variable with the var
keyword.
In JavaScript, variables are scoped in two ways ONLY:
- Global Scope
- Functional Scope
This is a great article for beginners who are just starting out with JavaScript, and can help build a good background on the subject matter.
1 Comment so far