title: Promise syntax / alternative
body: <p>I wish to return a Promise which is self-resolved at a later time, but it seems that my syntax is invalid, and I'm curious what a better implementation would be. Why is an executor required for the Promise constructor?</p>
  
  <blockquote>
    <p><code>promise = new Promise()</code> is invalid because I need to supply a function</p>
  </blockquote>
  
  <pre class="lang-js prettyprint-override"><code>function getDetails (someHash) {
      var url = "http://somewebsite.com/" + someHash,
          promise = new Promise();
  
       makeAjaxRequest(url, function (response) {
           promise.resolve(response.data);
       });
  
       setTimeout(function () {
           promise.reject("timeout");
       }, 500);
  
       return promise;
  }
  
  function makeAjaxRequest (url, callback) {
      var someResponse = {data: "some data"};
  
      setTimeout(function () {
          callback(someResponse);
      }, 200);
  }
  </code></pre>
  
  <p>Is there a better way to implement this functionality?</p>