Skip to content

Instantly share code, notes, and snippets.

@ktilcu
Last active January 6, 2018 18:23
Show Gist options
  • Select an option

  • Save ktilcu/6cdb3b9ccd185675496d33e99e83743e to your computer and use it in GitHub Desktop.

Select an option

Save ktilcu/6cdb3b9ccd185675496d33e99e83743e to your computer and use it in GitHub Desktop.
const getAvatars = async (userId) => {
const user = await getUser(userId);
const avatar = await user.avatar();
const friends = await user.friends();
const avatars = [avatar];
for (let friend of friends) {
avatars.push(await friend.avatar());
}
return avatars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment