let friendsWithPhotos = friendsPromise.map(friend => { return {friend, photo: friend.has_photo ? api.getUserPhoto(friend.id) : default_photo}; }