Skip to content

Commit 2b234a6

Browse files
paitonicbevacqua
authored andcommitted
Fix typo System.iterator -> Symbol.iterator (#71)
1 parent 13e0158 commit 2b234a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ch04.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ console.log([...salute('you')])
11691169
// <- ['h', 'e', 'l', 'l', 'o', ' ', 'y', 'o', 'u']
11701170
----
11711171
1172-
To reiterate, you can `yield*` anything that adheres to the iterable protocol, not merely strings. That includes generator objects, arrays, `arguments`, `NodeList` in the browser, and just about anything, provided it implements `System.iterator`. The following example demonstrates how you could mix `yield` and `yield*` statements to describe a sequence of values using generator functions, an iterable object, and the spread operator. Can you deduce what the `console.log` statement would print?
1172+
To reiterate, you can `yield*` anything that adheres to the iterable protocol, not merely strings. That includes generator objects, arrays, `arguments`, `NodeList` in the browser, and just about anything, provided it implements `Symbol.iterator`. The following example demonstrates how you could mix `yield` and `yield*` statements to describe a sequence of values using generator functions, an iterable object, and the spread operator. Can you deduce what the `console.log` statement would print?
11731173
11741174
[source,javascript]
11751175
----

0 commit comments

Comments
 (0)