Arch  Hessel

Arch Hessel

1624688400

5 Stories That May Help You to Understand JavaScript Closures Better

In this case, myFunc is a reference to the instance of the function displayName that is created when makeFunc is run. The instance of displayName maintains a reference to its lexical environment, within which the variable name exists. For this reason, when myFunc is invoked, the variable name remains available for use, and Mozilla is passed to Console.log().

That’s boring right? Let’s hear some stories developers tried to tell about Javascript closures.

If you can’t explain it simply, you don’t understand it well enough. — Albert Einstein

1. Ancient Princess and her fairy-tale

2. The Adventures of Pinocchio

3. Mr.Coder and Magical baseball

4. A little child and their home

5. Dan and The Xbox

#javascript

5 Stories That May Help You to Understand JavaScript Closures Better