Users(&quot;John&quot;),
  searchUsers(&quot;Mary&quot;),
])
.then(function(data) {
  // data[0] is an array of users whose names are John
  // data[1] is an array of users whose names are Mary

  // the returned value is equivalent to [
  //   getUserNames(data[0]),
  //   getUserNames(data[1]),
  // ]
  return data.map(getUserNames)
})
.then(alert)
</code></pre>
<p>In the example above, there are two user searches happening in parallel. Once they both complete, we take the names of all the users and alert