function* gen() { yield 1; yield 2 }
const it = gen()
console.log(it.next()) // β { value: 1, done: false }
console.log(it.next()) // β { value: 2, done: false }
console.log(it.next()) // β { value: undefined, done: true }A generator function returns a generator object that implements the iterator protocol via successive next() calls.
Check that an empty generator is immediately done.