re: Understand how to Memoize a JavaScript function VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What would be a potential context/use case for this optimization in the wild?
 

The summation function here is so simple. But consider you are making an expensive operation instead of just sum.In that case if you already have a cached value from previous call it becomes handy.

Even react.memo should be doing something similar to this(But handling all limitations which my solution had)

code of conduct - report abuse