title: "new self()" equivalent in Javascript
body: <p>I have a class like the following:</p>
  
  <pre><code>const Module = {
    Example: class {
      constructor(a) {
        this.a = a;
      }
  
      static fromString(s) {
        // parsing code
        return new Module.Example(a);
      }
    }
  }
  </code></pre>
  
  <p>This works so far, but accessing the current class constructor via the global name <code>Module.Example</code> is kind of ugly and prone to breaking.</p>
  
  <p>In PHP, I would use <code>new self()</code> or <code>new static()</code> here to reference the class that the static method is defined in. Is there something like this in Javascript that doesn't depend on the global scope?</p>