What is a closure? In this Javascript Tutorial, we’re going to be learning about closures – our 3rd most misunderstood concept of Javascript.

Watch the full playlist:

Hopefully, we’re going to break it down enough to make it simple to understand for newbies and intermediate coders alike.

Javascript closures are really not that complex of an idea.

The textbook definition of a closure is a function that retains state and scope after it executes. Basically put, when the function’s done, a callback might need to access the variables inside later…so Javascript remembers those variables. That remembering of the variables is called a closure.

Source: LearnCode.academy




Comments are closed.