for/of with async/await
JavaScript
const ids = [1, 2, 3, 4, 5];
const request = id => fetch(`https://jsonplaceholder.typicode.com/todos/${id}`);
async function makeRequestsInChain (data) {
for (item of data) {
await request(item);
}
}
makeRequestsInChain(ids);