FrontEnd.ro logo
async-await
async function fetchUsers(usernames) {
  let userProfiles = [];

  for (let username of usernames) {
    let response = await fetch(`https://api.github.com/users/${username}`);
    let userJSON = await response.json();

    userProfiles.push(userJSON);
  }

  return userProfiles;
}