January 30, 2021

Javascript Environments 1 - Execution Context and Environment Records

Have you ever wondered how Javascript engines implement scope? Where bindings live? Or how closures really work? At the bottom of these questions are environments. In my experience, gaining an understanding of environments gives much needed clarity to several important concepts, especially scope and closures. It becomes apparent ‘odd’ behaviour of Javascript that causes frustration becomes apparent