title: Get class name in constructor
body: <pre><code>export class InvalidCredentialsError extends Error {
    constructor(msg) {
      super(msg);
      this.message = msg;
      this.name = 'InvalidCredentialsError';
    }
  }
  </code></pre>
  
  <p>As you can see above, I'm writing <code>InvalidCredentialsError</code> twice. Is there a way to somehow get the class name already in the constructor method and set it? Or does the object have to be instantiated?</p>