JavaScript
Result
Run
License
async function* myGeneratorFunc(p1, p2) { yield await Promise.resolve(p1 + p2); yield await new Promise(resolove => resolove(p1 * p2)); } const genfunc = myGeneratorFunc(10, 1); genfunc.next().then(result => console.log(result.value)); genfunc.return("finished").then(result => console.log(result.value)); genfunc.next().then(result => console.log(result.value));
Console
expand_less
License
License
by DevDic
Close