Practice ยท 3 of 3
Memoize with a Map
CHALLENGE
Difficulty: intermediate+25 XP
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.
Press Submit to check your solution.
Back to lesson: Practice: Closures โ Practice