@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.

--

Front-end web developer and graduate student from Microverse.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdo Amin

Abdo Amin

Front-end web developer and graduate student from Microverse.