fixes #1669
This commit is contained in:
parent
2483af0eda
commit
994390265a
5 changed files with 19 additions and 20 deletions
|
@ -140,7 +140,7 @@ for(let value of generator) {
|
|||
}
|
||||
```
|
||||
|
||||
As generators are iterable, we can call all related functionality, e.g. the spread operator `...`:
|
||||
As generators are iterable, we can call all related functionality, e.g. the spread syntax `...`:
|
||||
|
||||
```js run
|
||||
function* generateSequence() {
|
||||
|
@ -154,7 +154,7 @@ let sequence = [0, ...generateSequence()];
|
|||
alert(sequence); // 0, 1, 2, 3
|
||||
```
|
||||
|
||||
In the code above, `...generateSequence()` turns the iterable generator object into an array of items (read more about the spread operator in the chapter [](info:rest-parameters-spread-operator#spread-operator))
|
||||
In the code above, `...generateSequence()` turns the iterable generator object into an array of items (read more about the spread syntax in the chapter [](info:rest-parameters-spread#spread-syntax))
|
||||
|
||||
## Using generators for iterables
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue