Overview

  1. Environment Record: an object that has all local variables as its properties (and some other information like the value of this).
  2. A reference to the outer lexical environment, usually the one associated with the code lexically right outside of it (outside of the current curly brackets).

http://javascript.info/article/closure/lexical-environment-global@2x.png

http://javascript.info/article/closure/lexical-environment-global-2@2x.png

Function Declaration

http://javascript.info/article/closure/lexical-environment-global-3@2x.png