Pillars of JavaScript 1. Closure

Read the blog, grasp closure’s concept, code in the playground for 10 mins, learn and improve.Ask yourself questions and try to answer on your own and seek help.Happy coding!

Pillars of JavaScript:

  1. Closure
  2. Prototypal inheritance

Techie: Oh, interesting! What is Closure? 

let’s take a closer look at the concept of closure.

Prerequisite: Understanding Lexical Scope

Definition: Closure is the ability to remember variables that are defined in the outer function even when the parent function has finished its execution.

In simpler terms: Closure is the combination of a function and its lexical scope.
Closure = function() + Lexical Scope

Click Here