// this seems like a generator function, but there's a catch ...function*sequence(...iterables){ // -------------------------------------------------------------- // โญ `yield/yield*` only available within generator functionsโ // -------------------------------------------------------------- // โ but this `yield*` is within an "arrow function"โ // // โญโโโ ๐ธ arrow function โโโโฎiterables.forEach( iterable=>yield*iterable ); // ^^^^^^ // โ ReferenceError: yield is not defined }
when the "expressionafter yield" is evaluated and yielded, the execution of the generator code stops right there, and the value of the "yield expression" itself is still undefined and waiting for the next call of next() to send it in. (will remain undefined if there's no furthernext() call any more)
can be considered as a new starting point for the next callofnext().