function getTime(seconds){ return new Promise(resolve=>{ setTimeout(() => { resolve(seconds) }, seconds); }) } async function test(){ let arr = [getTime(2000),getTime(300),getTime(1000)] for await (let x of arr){ console.log(x); // 2000 300 1000 按顺序的 } } test()