2 ms·
Very cool, a quick JS example using Addy's memoize function: http://goo.gl/TUldBl http://goo.gl/TUldBl I could see using this to help junior engineers visualiz
by jastanton 11y ago
Very cool, a quick JS example using Addy's memoize function:
http://goo.gl/TUldBl http://goo.gl/TUldBl
I could see using this to help junior engineers visualize code flow before showing them how to step through code in Chrome dev tools
- foxylion 11y agoYour 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