How to explain closures in javascript and when to use it