Advanced topics become easy to grasp once you know how it works.
The with operator allows to use an arbitrary object as the scope.
From the previous article, we know that a variable is a property of the LexicalEnvironment object.
Here we discuss access to outer variables and nested functions. In-depth understanding of closures follows automatically.
Donate to this project
The content of this site is available under the terms of CC BY-NC-SA.
© Ilya Kantor, 2011.