Abdo Amin
Sep 7, 2022

--

@Ajay Solanke Correct! each will have a separate execution context and thus separate cache.

@Vasanth Bhat Each instance of `memoize` has a different cache.

In your article, "Sample cache object looks like below" the first logged object is the cache of `memoiseAdd`, the second logged object is the cache of `memoriseMultiply`.

Thus, it is not important to store the function name to the key of the cache, just the arguments are enough.

--

--

Abdo Amin
Abdo Amin

Written by Abdo Amin

I love React and anything that has JavaScript and frontend in it.

No responses yet