Async/Await Syntax
What is the benefit of this pattern with async/await?
async function parallel() {
const [result1, result2] = await Promise.all([
fetch('/api/1'),
fetch('/api/2')
]);
return [result1, result2];
}
async function parallel() {
const [result1, result2] = await Promise.all([
fetch('/api/1'),
fetch('/api/2')
]);
return [result1, result2];
}