function first(){ console.log("1")}function second(){ new Promise ((resolve,reject)=>{ setTimeout(function(){ console.log("2") resolve(); } ,0); }) }function third(){ console.log("3")} async function run(){ first(); await second(); third();}run();需要使函數調用同步以獲得最終輸出 1,2,3 我嘗試創建 promise 并使用 async await 但這對任何其他方式都沒有幫助
使函數調用同步
慕桂英4014372
2022-12-22 15:49:56