JavaScript for Beginners: Variable Scope Rules
comment 1

JavaScript for Beginners: Variable Scope Rules

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:

  1. Global Scope
  2. 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.

Check it out

Filed under: JavaScript

About the Author

Posted by

Hakim is the Front End Developer for Stampede. Recently jumped into the boardgames scene. Interested in HCI, Design Thinking and User Experience. Netflix hogger.

1 Comment so far

Leave a Reply