Skip to content

Commit

Permalink
Merge pull request getify#669 from magul/fixing-return-in-generator
Browse files Browse the repository at this point in the history
fixing value returned from generator
  • Loading branch information
getify committed Feb 21, 2016
2 parents 0a42d08 + 103043e commit 86595c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion es6 & beyond/ch3.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ for (var v of bar()) {
console.log( v );
}
// 1 2 3
// x: 4
// x: { value: 4, done: true }
```

While the `1`, `2`, and `3` values are `yield`ed out of `*foo()` and then out of `*bar()`, the `4` value returned from `*foo()` is the completion value of the `yield *foo()` expression, which then gets assigned to `x`.
Expand Down

0 comments on commit 86595c3

Please sign in to comment.