Where I learnt, how to properly setup a closure in JS