标签:com ref https promise ISE href foo wait ast
https://v8.dev/blog/fast-async
async function computeAnswer() {
return 42;
}
undefined
const p = computeAnswer();
undefined
p.then(console.log);
42
Promise {<resolved>: undefined}
async function foo() {
const v = await 42;
return v;
}
undefined
const p = foo();
undefined
p.then(console.log);
42
Promise {<resolved>: undefined}
Faster async functions and promises
标签:com ref https promise ISE href foo wait ast
原文地址:https://www.cnblogs.com/yuanjiangw/p/11600106.html