title: Are there meaningful performance differences for declaring variables inside javascript class constructor vs a method called inside said constructor?
body: <p>I'm really new to JS and stackoverflow but not new to coding so forgive me if this has already been answered somewhere.</p>
  <p>The reason to do it the second way would only be to improve the 'neatness' of the class.  I'm wondering if there are performance trade-offs for readability by doing it that way.</p>
  <p>To be more clear:</p>
  <p>is there a performance loss from doing this:</p>
  <pre><code>class MyClass{
      constructor(args){
          this.UpdateClass(args);
      }
      UpdateClass(args){
          this.firstVar = this.GetFirstVar();
          this.secondVar = this.GetSecondVar(args);
      }
      GetFirstVar(){
          return 420;
      }
      GetSecondVar(args){
          return args.Cheesesteak;
      }
  }
  </code></pre>
  <p>Instead of doing this:</p>
  <pre><code>class MyClass{
      constructor(args){
          this.firstVar = this.GetFirstVar();
          this.secondVar = this.GetSecondVar(args);
      }
      UpdateClass(args){
          this.firstVar = this.GetFirstVar();
          this.secondVar = this.GetSecondVar(args);
      }
      GetFirstVar(){
          return 420;
      }
      GetSecondVar(args){
          return args.Cheesesteak;
      }
  }
  </code></pre>
  <p>My interpretation of reading Google's js style guide was that they should always declare class variables inside the constructor because it's more computationally expensive to declare class variables inside another method, but is that still the case when the class method defines and/or updates every class variable without exception.</p>