Skip to content
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
6 changes: 3 additions & 3 deletions manuscript/markdown/References and Rebinding/reassignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ You can do the same thing with both syntaxes for accessing objects:
name.middleName = 'Austin'
name
//=> { firstName: 'Leonard',
# lastName: 'Braithwaite',
# middleName: 'Austin' }
// lastName: 'Braithwaite',
// middleName: 'Austin' }

We have established that JavaScript's semantics allow for two different bindings to refer to the same value. For example:

Expand Down Expand Up @@ -107,4 +107,4 @@ The outer value of `allHallowsEve` was not changed because all we did was rebind

This is different. We haven't rebound the inner name to a different variable, we've mutated the value that both bindings share. Now that we've finished with mutation and aliases, let's have a look at it.

T> JavaScript permits the reassignment of new values to existing bindings, as well as the reassignment and assignment of new values to elements of containers such as arrays and objects. Mutating existing objects has special implications when two bindings are aliases of the same value.
T> JavaScript permits the reassignment of new values to existing bindings, as well as the reassignment and assignment of new values to elements of containers such as arrays and objects. Mutating existing objects has special implications when two bindings are aliases of the same value.