1const fetchAll = async (urls) => { 2 const responses = await Promise.all(urls.map(url => fetch(url))); 3 return Promise.all(responses.map(res => res.json())); 4};
Fetch multiple endpoints in parallel with Promise.all.