Demystifying JavaScript Closures, Callbacks and IIFEs

Let’s be clear about something first. This isn’t the same argument you made above.

The outer function never has access to the inner function’s variables. Rather, the inner function has access to the outer function’s variables. The article didn’t get it backwards, you did.

And finally, I would agree that a closure only seems useful if we use the inner function sometime after the outer has finished, but if we’re going to get technical, then the closure is actually created at the moment that we create the inner function.