The code states the function references a global variable, but it
doesn't, it just references a variable outside the scope of the
Hat tip to @matbad who emailed me to point out my mistake.
This code example isn't necessarily the best or most clear...so the discussion here might be to just remove this example, or add a clearer one, but I did fix the original error.
Fix an incorrect sentence for a code example.
There's also #452 which expands the section.
I think the addition of "then executed" will just add confusion for new users. The phrasing "outside of a function's scope" is also confusing as it sounds like you're referring to a variable that the function can't actually see, as opposed to one that it can see but was defined in a higher scope.
I'm going to close this, but feel free to send another pull request with different wording.