Luis Munoz
05/19/2020, 8:42 PMfunction* generatorFunction(i) {
yield i
yield i +1
}
let gen = generator(5)
gen.next() // value=5, done=false
gen.next() // value=6, done=false
// WHAT I WANT IS THIS
gen.next(100) // <-- here I pass value and get back another value at next yield point
so in generator
it would be let x = yield i to get the input valueoctylFractal
05/19/2020, 8:45 PMLuis Munoz
05/19/2020, 8:48 PMoctylFractal
05/19/2020, 9:42 PMsequence
because there's no scopeLuis Munoz
05/19/2020, 9:43 PMoctylFractal
05/19/2020, 9:43 PMLuis Munoz
05/19/2020, 9:43 PMaraqnid
05/19/2020, 9:44 PMyield
Luis Munoz
05/19/2020, 9:51 PM