Couple of months back, when I started looking at Scala as a programming language, a key computer programming concept came up - Closure. I couldn't find a page which explains what it is and how to use it, so here it goes,
A closure is a first-class function with free variables that are bound in the lexical environment. (Source wikipedia)
First-class functions are those that can be assigned to a variable to be carried around and be executed at a later point of time. Subsequently this will enable those functions being passed as arguments, as well as returned back. An example in Scala is shown below.