Can I yield from an inner function?
No, you can’t use yield inside of the inner function. But in your case you don’t need it. You can always use for-of loop instead of forEach method. It will look much prettier, and you can use continue, break, yield inside it: var trivialGenerator = function *(array) { for (var item of array) { // … Read more