You pass your counter into the function, it returns a function that remembers the original value, not the value as it keeps iterating later on in the caller.
That's an interesting definition. I thought you would either go with https://en.wikipedia.org/wiki/Functor_(functional_programmin... or with https://en.wikipedia.org/wiki/Function_object
https://en.wikipedia.org/wiki/Functor_(disambiguation) has a few more choices, but doesn't seem to have yours.
You pass your counter into the function, it returns a function that remembers the original value, not the value as it keeps iterating later on in the caller.