requests

by Roman Fedytskyi

JavaScript

const urls = [
	'https://swapi.co/api/people/1/',
  'https://swapi.co/api/films/1/',
  'https://swapi.co/api/starships/'
];

const requests = urls.map(item => fetch(item));

Promise.all(requests).then(response => {
	console.log(response);
  const results = response.map(item => item.json());
  console.log(results);
  Promise.all(results).then(result => console.log('result', result));
});