This is a gotcha which I keep stumbling into every so often, using forEach to iterate over an async iterable.
What I should be doing is using for await
for await (const num of foo()) {
console.log(num);
// expected output: 1
break; // closes iterator, triggers return
}