Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1bdfb90

Browse files
committedJun 16, 2017
Edited ch09.asciidoc with Atlas code editor
1 parent 3f62116 commit 1bdfb90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎ch09.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ Compare that to the equivalent snippet using object spread declaratively. We hav
557557
}
558558
----
559559

560-
Being able to visualize object spread as an `Object.assign` helps internalize how the feature works. In the following example we've replaced the `defaults` and `options` variables with object literals. Since object spread relies on the same operation as `Object.assign` for every property, we can observe how the `options` literal overrides `speed`, with the number `3`; and why `important` remains `true` even when the `options` literal attempts to override it, due to precedence.
560+
Being able to visualize object spread as an `Object.assign` helps internalize how the feature works. In the following example we've replaced the `defaults` and `options` variables with object literals. Since object spread relies on the same operation as `Object.assign` for every property, we can observe how the `options` literal overrides `speed` with the number `3`, and why `important` remains `true` even when the `options` literal attempts to override it, due to precedence.
561561

562562
[source,javascript]
563563
----
@@ -574,7 +574,7 @@ Being able to visualize object spread as an `Object.assign` helps internalize ho
574574
}
575575
----
576576

577-
Object spread comes in handy when we're dealing with immutable structures, where we're supposed to create new objects instead of editing existing ones. Consider the following bit of code where we have a `player` object and a function call that casts a healing spell and returns a new, healthier, player object.
577+
Object spread comes in handy when we're dealing with immutable structures, where we're supposed to create new objects instead of editing existing ones. Consider the following bit of code where we have a `player` object and a function call that casts a healing spell and returns a new, healthier, +player+ object.
578578

579579
[source,javascript]
580580
----
@@ -713,7 +713,7 @@ const double = x => x * 2
713713
const print = x => { console.log(x) }
714714
----
715715

716-
Arrow functions can return arrays using tiny expressions. The first example in the next snippet implicitly returns an array comprised of two elements, while the second example discards the first parameter and returns all other parameters held in the rest operator's bag.
716+
Arrow functions can return arrays using tiny expressions. The first example in the next snippet implicitly returns an array comprising two elements, while the second example discards the first parameter and returns all other parameters held in the rest operator's bag.
717717

718718
[source,javascript]
719719
----

0 commit comments

Comments
 (0)
Please sign in to comment.