Hi Nick!
Thanks for the post!
Could someone clarify me please, why "const results = {}" is stays the same on each call of method "memoize()"? I thought it will be created each time on call "memoize()" and this approach wouldn't work, but seems like it works! :)
Hi Nick!
Thanks for the post!
Could someone clarify me please, why "const results = {}" is stays the same on each call of method "memoize()"? I thought it will be created each time on call "memoize()" and this approach wouldn't work, but seems like it works! :)
Thanks.
It's because of closures & lexical scoping, Fikret
developer.mozilla.org/en-US/docs/W...
Yeah... i didn't notice that "memoize()" called only once.