📜  使用 asyn await javascript 代码示例的并行和顺序实现

📅  最后修改于: 2022-03-11 15:04:27.959000             🧑  作者: Mango

代码示例2
async function inParallel() {
   const promise1 = printNumber1();
   const promise2 = printNumber2();
   const number1 = await promise1;
   const number2 = await promise2;
}
//Output: Number2 is done, Number1 is done