fixes
This commit is contained in:
parent
0b55d45daf
commit
3caa91137e
8 changed files with 21 additions and 33 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Generators
|
||||
|
||||
Regular functions return only one, single value (or nothing).
|
||||
|
@ -224,8 +223,6 @@ let range = {
|
|||
alert( [...range] ); // 1,2,3,4,5
|
||||
```
|
||||
|
||||
The `range` object is now iterable.
|
||||
|
||||
That works, because `range[Symbol.iterator]()` now returns a generator, and generator methods are exactly what `for..of` expects:
|
||||
- it has `.next()` method
|
||||
- that returns values in the form `{value: ..., done: true/false}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue