Skip to content

Fix an incorrect sentence for a code example. #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

jackfranklin
Copy link
Contributor

The code states the function references a global variable, but it
doesn't, it just references a variable outside the scope of the
function.

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.

The code states the function references a global variable, but it
doesn't, it just references a variable outside the scope of the
function.
@scottgonzalez
Copy link
Member

There's also #452 which expands the section.

@scottgonzalez
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants