title: ES6 native Promise from Factory Function
body: <p>I'm doing a deep dive into ES6 native Promises. Along the way I came across some articles  that quote <a href="https://tsherif.wordpress.com/2013/08/04/constructors-are-bad-for-javascript/" rel="nofollow noreferrer">Douglas Crockford design choices</a> regarding <em>not</em> using things like <code>new</code>, <code>Object.create</code>, <code>this</code>, etc. Some people are advocating the use of <a href="https://medium.com/javascript-scene/common-misconceptions-about-inheritance-in-javascript-d5d9bab29b0a" rel="nofollow noreferrer">Factory Functions</a> over constructors. I have also learnt that there is a lot of <a href="https://stackoverflow.com/questions/383402/is-javascripts-new-keyword-considered-harmful">heated debate</a> regarding those choices. So to avoid having this question listed as <em>not constructive</em>, I'd like to ask this specific question.</p>
  
  <p>How can I create a <em>factory function</em> for a Promise without using <em>new</em>?</p>
  
  <pre><code>// from [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
  
  var promise1 = new Promise(function(resolve, reject) {
    setTimeout(resolve, 100, 'foo');
  });
  
  console.log(promise1);
  // expected output: [object Promise]
  </code></pre>
  
  <p>This is also true for using things like building a <em>new</em> <code>Headers()</code> for a <code>fetch</code>.</p>
  
  <p>At some point in the factory function, I'm going to have to write:</p>
  
  <pre><code>new Promise();
  </code></pre>
  
  <p>Are DC and the other authors referring to custom objects only, and not builtins? What about all the other <a href="https://developer.mozilla.org/en-US/docs/Web/API" rel="nofollow noreferrer">API's</a> that require the use of <em>new</em>?</p>