title: Can JavaScript constructor return function and keep inheritance?
body: <pre><code>function F() {
      return function() {
          return {};
      }
  }
  
  var f = new F();
  f instanceof F; // returns false
  </code></pre>
  
  <p>As far as I understand, if I want <code>instanceof</code> to work, I need to return <code>this</code> from the constructor. But I want the constructor to return a function, and I cannot assign to <code>this</code>.</p>
  
  <p>So, is this really impossible or can it be done somehow, for <code>f = new F()</code> to return a function and still <code>f instanceof F</code> to return true?</p>