inner function is said to have closure over the variable
Thanks for the article Nikhil Vijayan !!! This is a very clear way of putting it that I think gets lost in some of the discussion of closures.
PS Your code samples would be a lot more readable if you copy-pasted them into Gists (gist.github.com) and then pasted the Gist link into Medium.