9
Closures
In this Chapter
Understand what closures are
Tie together everything you’ve learned about functions, variables, and scope
By now, you probably know all about functions and all the fun things they do. An important part of working with functions, in JavaScript, and (possibly) life in general, is understanding the topic known as closures. Closures touch upon a gray area where functions and variable scope intersect.
Now, I am not going to say any more about closures because this is something best explained by seeing code. Any words I add right now to define or describe what closures are will only serve to confuse things. In the following ...
Get Javascript Absolute Beginner's Guide, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.