JavaScript Lexical Scope, Lexical Environment, Scope Chain & Closure — Explained Like the JS Engine

Most developers memorize definitions of Lexical Scope, Lexical Environment, and Closure without understanding what actually happens inside…