Skip to content

Update this.md #114

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manuscript/markdown/Objects, Mutation, and State/this.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Any time we must do the same repetitive thing over and over and over again, we i
banksQueue.pushTail('Hello');
banksQueue.pushTail('JavaScript')

Every time you invoke a function that is a member of an object, JavaScript binds that object to the name `this` in the environment of the function just as if it was an argument.[^this] Now we can easily make copies:
Every time you invoke a function that is a member of an object, JavaScript binds that object to the name `this` in the environment of the function just as if it were an argument.[^this] Now we can easily make copies:

copyOfQueue = extend({}, banksQueue)
copyOfQueue.array = []
Expand All @@ -145,4 +145,4 @@ There is more to `this` than we've discussed here. We'll explore things in more

T> Closures tightly couple functions to the environments where they are created limiting their flexibility. Using `this` alleviates the coupling. Copying objects is but one example of where that flexibility is needed.

[^this]: JavaScript also does other things with `this` as well, but this is all we care about right now.
[^this]: JavaScript also does other things with `this` as well, but this is all we care about right now.