title: javascript, polymorphic new Myclass()?
body: <p>I have many classes that has the following form.</p>
  
  <pre><code>static defaultInstance() {
  
   if (!defaultInstance) {
     defaultInstance = new Child1()
   }
   return defaultInstance
  }
  </code></pre>
  
  <p>Since they have a common base class, I wanted to add the common function to the base class, but don't know how.<br>
  (having trouble with new Child1())</p>