Async/Await Syntax
What is the key difference between these two functions?
async function processItems(items) {
const results = [];
for (const item of items) {
results.push(await processItem(item));
}
return results;
}
async function processItemsParallel(items) {
return Promise.all(items.map(item => processItem(item)));
}