Chandra Gundamaraju
1 min readJan 19, 2017

--

Great deep dive. I have never thought about onions and closures in the same sentence before :) Here is my attempt at explaining closures to beginners:

I often use “Russian nesting doll” as a metaphor to explain nested scopes.

I left one minor private note for you, more to do with MDN documentation than this post. One of the confusions for beginners is around attributing closures to a tangible thing like object, function, etc… So I often find it easier to explicitly callout that closure is not a tangible thing: it’s neither an object nor a function.

--

--

Chandra Gundamaraju
Chandra Gundamaraju

Written by Chandra Gundamaraju

For my day job @Salesforce, I write code for machines; But in my free time, I pursue this wild hobby of writing for humans. {Learn | Code | Read | Write}

No responses yet