示例代码: ```javascript const f = async a => { return new Promise(resolve => { setTimeout(() => { resolve(a) }, 1000) }) } [1, 2, 3, 4, 5].forEach(async item => { const b = await f(item) console.log(b) }) ``` 该代码执行后会在1秒钟之后输出1, 2, 3, 4, 5 [async和await:让异步编程更简单 - 学习 Web 开发 | MDN](https://developer.mozilla.org/zh-CN/docs/Learn/JavaScript/Asynchronous/Async_await)