Cache function execution in javascript : I recently had an interview where I was asked that how could you cache execution of any function? I was stuck with answer as I heard about **Functional Caching in Javascript** only.

I checked on [Stack overflow][1] but not getting any idea from this.Is there any way to cache execution of any function in javascript?


  [1]: https://stackoverflow.com/questions/6090391/how-is-this-javascript-function-caching-its-results