Your sample is a bit broken and it took me some time to find out what is broken. The memoized function is not actually returning anthing, so caching is not possible.
Also it has a side effect (console.log), so the second call won&#x27;t log. A better sample would be a method with a complicated, expensive calculation.<p>Fixed version: <a href="http:&#x2F;&#x2F;goo.gl&#x2F;fAyqcV" rel="nofollow">http:&#x2F;&#x2F;goo.gl&#x2F;fAyqcV</a>