{ console.log("setTimeout");}, 0);async1().t">
赞
踩
async function async1() { console.log("async1 start"); await async2(); console.log("async1 end"); return 'async1 return'; } async function async2() { console.log("async2"); } setTimeout(() => { console.log("setTimeout"); }, 0); async1().then((res) => { console.log(res) }); new Promise((resolve) => { console.log("promise1"); resolve(); }).then(() => { console.log("promise2"); }); console.log("script end");
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。