Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very cool, a quick JS example using Addy's memoize function: 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



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: