Given a generator
gen = ->
j = 0
while j < 9
yield j++
return
how do we loop through it via the javascript for .. of loops? In javascript, we'd do
for (i of gen()) {
console.log(i);
}
The coffeescript for i in gen() gives the C-style for (_i = 0; _i < gen().length; i++) loops, and for i of gen() gives for (i in gen()). Is there some way to get for (i of gen()) that I didn't see in the documentation?