I looked at the generator functions on the Mozilla Dev page.
There was an example code that has a send () function .
function* fibonacci() {
var a = yield 1;
yield a * 2;
}
var it = fibonacci();
console.log(it);
console.log(it.next());
console.log(it.send(10));
console.log(it.close());
console.log(it.next());
But, both chrome and Firefox (latest version) throw an error on the send () function.
Any views on this? Is this not supported?
source
share