Course · Section 10: A Closer Look at Functions · Lecture 144: Closures
Implement `counterValues(n)` that builds a counter using a closure and returns the array of values it produces over `n` calls: `[1, 2, ..., n]`.
+ 1 hidden test run on Submit.
The inner function captures count by closure, so each call increments the same private variable, producing 1..n.
Run your code to see results.