title: Map Promise.all output with promises index
body: <p>I am using nodejs v8+ which supports default async await style of code.</p>
  
  <p>In my problem, I am trying to push all the promises into an array and then use Promise.all to with await keyword to get the responses. But the problem is, I am not able to map the promises with the keys.</p>
  
  <p>Here is the example:</p>
  
  <pre><code>let users = ["user1", "user2", "user3"];
  
      let promises = [];
      for(let i = 0; i &lt; users.length; i++){
        let response = this.myApiHelper.getUsersData(users[i]);
        promises.push(response);
      }
      let allResponses = await Promise.all(promises);
  </code></pre>
  
  <p>Here I get all the collected response of all the responses, but I actually want to map this by user. 
  For example currently I am getting data in this format:</p>
  
  <pre><code>[
  {
    user1 Data from promise 1
  },
  {
    user2 Data from promise 2
  },
  {
    user3 Data from promise 3
  }
  ]
  </code></pre>
  
  <p>But I want data in this format:</p>
  
  <pre><code>[
   {
    "user1": Data from promise 1
   },
   {
     "user2": Data from promise 2
   },
   {
     "user3": Data from promise 3
   }
  ]
  </code></pre>
  
  <p>I am sure there must be a way to map every promise by user, but I am not aware of.</p>