Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Javascript Closures Tutorial – What makes Javascript Weird…and Awesome Pt 3

119.5K views on YouTube

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.

-~-~~-~~~-~~-~-
Also watch: “Responsive Design Tutorial – Tips for making web sites look great on any device”

-~-~~-~~~-~~-~-