title: How do I use a static variable in ES6 class?
body: <p>I'm trying to use a static variable in es6. I'd like to declare a static variable <code>count</code> in <code>Animal</code> class and increase it. However, I couldn't declare a static variable through <code>static count = 0;</code>, so I tried another way like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Animal {
    constructor() {
      this.count = 0;
    }
  
    static increaseCount() {
      this.count += 1;
    }
  
    static getCount() {
      return this.count;
    }
  }
  
  console.log(Animal.increaseCount()); // undefined
  console.log(Animal.getCount()); // NaN</code></pre>
  </div>
  </div>
  </p>
  
  <p>I expected <code>console.log(Animal.getCount());</code> to be <code>1</code>, but it doesn't work. 
  How do I declare a static variable and modify it by calling a method? </p>