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.
JS is the backbone of front end development. This article is pretty basic but like it says it’s a very good start for beginners. Also I would like to recommend another great javascript resource to create charts with Google Charts API http://www.kodingmadesimple.com/2014/11/create-3d-pie-charts-with-javascript-google-charts-api.html
Thanks!