Course · Section 10: A Closer Look at Functions · Lecture 144: Closures
Implement `memoSquares(nums)` that squares each number, caching results in a closure, and returns the array of squares.
+ 1 hidden test run on Submit.
The cache lives in the closure, so repeated inputs reuse stored squares across calls.
Run your code to see results.