Good example of a closure in JavaScript

“The inner function is said to have closure over the variable a

Dr. Derek Austin 🥳
1 min readSep 25, 2019

--

Thanks for the article !!! This is a very clear way of putting it that I think gets lost in some of the discussion of closures.

PS Your code samples would be a lot more readable if you copy-pasted them into Gists (gist.github.com) and then pasted the Gist link into Medium.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)