Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

corrected translation to english errors in 'var' lesson #456

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
tgentry300 wants to merge 1 commit into javascript-tutorial:master from tgentry300:master

Conversation

@tgentry300
Copy link

@tgentry300 tgentry300 commented Jul 3, 2018

No description provided.

Copy link

CLAassistant commented Jul 3, 2018
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link
Member

iliakan commented Jul 3, 2018

Are you a native speaker?

Copy link
Contributor

Yes, @iliakan, he's one of my students.

```

Because all `var` declarations are processed at the function start, we can reference them at any place. But variables are undefined until the assignments.
Because all `var` declarations are processed at the function start, we can reference them at any place. But variables are undefined until they are explicitly defined.
Copy link
Member

@iliakan iliakan Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined until they are explicitly assigned (=).

davegregg reacted with thumbs up emoji

1. Variables have no block scope, they are visible minimum at the function level.
2. Variable declarations are processed at function start.
1. `var`Variables have no block scope, they are not block-local and can be accessed from any point in the script.
Copy link
Member

@iliakan iliakan Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong, they are function-local, so can't be "accessed from any point in the script" =)

Copy link
Member

@iliakan iliakan Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if rephrasing is good here...

Copy link
Contributor

@davegregg davegregg Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some rephrasing is good here. In this case, I had intended to submit another PR to add precision.

Copy link
Contributor

@davegregg davegregg Jul 5, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps: Variables declared with `var` have function-level scope, instead of block-level scope.

Copy link
Member

@iliakan iliakan Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

iliakan commented Jul 5, 2018

Let's ensure maximum clarity and correctness with this subtle topic.

But `var` is a very different beast, that originates from very old times. It's generally not used in modern scripts, but still lurks in the old ones.

If you don't plan meeting such scripts you may even skip this chapter or postpone it, but then there's a chance that it bites you later.
If you don't plan on reading or editing such scripts you may even skip this chapter, but there is a chance that you will see `var` in old scripts that you are reading and/or editing.
Copy link
Member

@iliakan iliakan Aug 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double wording: reading/editing.

Copy link
Member

@iliakan iliakan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments please. Or is the PR dead?

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

Reviewers

@iliakan iliakan iliakan requested changes

+1 more reviewer

@davegregg davegregg davegregg approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /