3 ms·
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 poss
by foxylion 11y ago
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't log. A better sample would be a method with a complicated, expensive calculation.
Fixed version: http://goo.gl/fAyqcV http://goo.gl/fAyqcV