Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The memoization in javascript is strange because of a few things; which are implemented in this kata:
Objects in and out of scope of the inner and outer function call when this tests assertions are run are necessary. You want to store records of the innjer function results outside of the it to avoid its execution when it already can have data stored containing its signature, and result.
The test assertions in this are kind of unclear, you need to store the result of the function in (usually) four concurrent calls:
Logic map cache(innerfunction) -> check if data is stored -> if it is not store it and run function, otherwise pull from cache without running.
If you are having trouble understanding, dumping the inner function being passed as a test case, to a string, will likely give you a better understanding.