A small sample that shows what "Memoization" is all about, through javascript.
MEMOIZATION ???!!??? Well, it is a means of saving/caching the result of a function pertaining to an argument(s) -- wherein future, this helps in preventing the execution of the same function with same argument(s), rather fetched from the cache.
-- PROS:
- Only function with unique arguments are executed fully. Repetitive ones are fetched from cache. High PERFORMANCE is the reward here.
- Would help a lot if you ever use RECURSIVE function anywhere.