t exist depending on whether there was data in localStorage
var promise = users ? Promise.resolve(users) : getUsers()
promise
  .then(getFirstTen)
  .then(getUserNames)
  .then(alert)
</code></pre>
<hr>
<h3 id="multiple-promises"><a href="#multiple-promises">Multiple promises</a></h3>
<p>In some occasions, you may need to make HTTP requests in parallel, and run code after all requests complete. This can be accomplished by <code>Promise.all</code></p>
<pre><code class="lang-javascript">Promise.all([
  search