1// store urls to fetch in an array
2const urls = [
3 'https://dog.ceo/api/breeds/list',
4 'https://dog.ceo/api/breeds/image/random'
5];
6
7// use map() to perform a fetch and handle the response for each url
8Promise.all(urls.map(url =>
9 fetch(url)
10 .then(checkStatus)
11 .then(parseJSON)
12 .catch(logError)
13))
14.then(data => {
15 // do something with the data
16})
17