Closures are simply anonymous functions. They are very helpful when you want a certain functionality in your app, but you don’t want to fill your namespace with lots of code. In this example, I will be demonstrating how you can use closures to limit the number of login attempts in a user’s account.

See more at-Classmite