title: Are JavaScript Promise asynchronous?
body: <p>Just a quick question of clarifications: is JavaScript <code>Promise</code> asynchronous? I've been reading a lot of posts on <code>Promise</code> and async programming (namely ajax requests). If <code>Promise</code> is not async, how do we make it so?</p>
  
  <p>For example, I have a function to wrap a function <code>f</code> with argument array <code>args</code> inside a <code>Promise</code>. Nothing about <code>f</code> inherently is async. </p>
  
  <pre><code>function getPromise(f, args) {
   return new Promise(function(resolve, reject) {
    var result = f.apply(undefined, args);
    resolve(result);
   });
  }
  </code></pre>
  
  <p>To make this async, I read some SO posts and decided that the <code>setTimeout</code> is what a lot of people were recommending to make code non-blocking.</p>
  
  <pre><code>function getPromise(f, args) {
   return new Promise(function(resolve, reject) {
    setTimeout(function() { 
     var r = f.apply(undefined, args);
     resolve(r);
    }, 0);
   });
  }
  </code></pre>
  
  <p>Would this approach with <code>setTimeout</code> work to make code non-blocking inside a <code>Promise</code>?</p>
  
  <p>(Note that I am not relying on any third-party Promise API, just what is supported by the browsers).</p>