ProUnebit
9/30/2018 - 7:34 AM

multi-promises

Multiple Promises

async function getData(names) {
      const promises = names.map(name => fetch(`https://api.github.com/users/${name}`).then(r => r.json()));
      const people = await Promise.all(promises);
      console.log(people);
    }

    getData(['prounebit', 'example2', 'example3']);