JavaScript para ... de com geradores
// generator function
function* generatorFunc() {
yield 10;
yield 20;
yield 30;
}
const obj = generatorFunc();
// iteration through generator
for (let value of obj) {
console.log(value);
}
SAMER SAEID