Example of JavaScript Closures

Here is an example of how to use a closure in JavaScript: