Practice ยท 3 of 3
Memoize with a Map
Write memoize(fn) that returns a cached version of a single-argument function. Calling the returned function with an argument it has seen before must return the remembered result **without calling fn again**.
Store previous results in a Map closed over by the wrapper.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Closures โ Practice