title: function F() { if (!(this instanceof F)) { return new F() }; ... }
body: <p>What is the usage of the construct: <code>function F() { if (!(this instanceof F)) { return new F() }; ... }</code>?</p>
  
  <p>I found this in a <code>pty.js</code> for Node. Here is the original code:</p>
  
  <pre><code>function Terminal(file, args, opt) {
    if (!(this instanceof Terminal)) {
       return new Terminal(file, args, opt);
    }
  
    var self = this
       , env
       , cwd
       , name
       , cols
       , rows
       , term;
  -------------------SKIP-----------------------------------
    Terminal.total++;
    this.socket.on('close', function() {
       Terminal.total--;
       self._close();
       self.emit('exit', null);
    });
  
    env = null;
  }
  </code></pre>