Understanding The Scope - with interactive Demo (play and learn)

The JavaScript uses the lexical scoping of variables. Simply the placement of the variable will determine who can access it. The access to the variable does not depend on how and when the code runs. Javascript determines the access of variables at compile time itself.

Play and Learn Here

Hierarchy of Scope In Javascript

submitted by /u/sanudelhi
[link] [comments]