title: What is return new function(); in JavaScript?
body: <p>In js code I have seen this used:</p>
  
  <pre><code>function doStuff( selector ) {
      /* Stuff to do with selector */
  }
  
  var q = function( selector ) {
      return new doStuff( selector );
  }
  </code></pre>
  
  <p>What exactly is happening? What is <code>return new</code> really doing? It seems to pass its arguments to the other function, but would someone please be kind enough to walk me through the process?</p>
  
  <p>All and any help is appreciated, thanks in advance.</p>