UP | HOME

Lexically Function Scoped

The following definition help to understand why need closure implement in JavaScript.

Functions in JavaScript are lexically rather than dynamically scoped. This means that they run in the scope in which they are defined, not the scope from which they are executed.