Understanding Scopes in JavaScript

One of the most important concepts in JavaScript, which one should master, is scope. Scopes are a little different in JavaScript compared to other languages like C# or Java. Scope defines the lexical memory space in which a variable, function or object is accessible for the JavaScript interpreter for it’s use during the run-time.