re><code class="lang-javascript">// this promise resolves after one second
var promise = new Promise(function(resolve, reject) {
  setTimeout(function() {
    resolve(&quot;hello&quot;)
  }, 1000)
})

promise.then(function(value) {
  // logs &quot;hello&quot; after one second
  console.log(value)
})
</code></pre>
<p>Promises are useful for working with asynchronous APIs, such as <a href="request.html"><code>m.request</code></a></p>
<p>Asynchronous APIs are those which typically take a long time to run, and 