Pete Hodgson

Using closures in a different way

One of JavaScript’s many wrinkles is the way that this works. It can
be a little confusing at first, but once you get the hang of it, it’s a powerful tool.

The first thing to understand is that this is a reference to the function that was passed to it. So, if you have a function called foo() and you pass it to a function called bar