title: Define a const in class constructor (ES6)
body: <p>Is there a way I can define a <code>const</code> in the constructor of a class?</p>
  
  <p>I tried this:</p>
  
  <pre><code>class Foo {
      constructor () {
          const bar = 42;
      }
  
      getBar = () =&gt; {
          return this.bar;
      }
  }
  </code></pre>
  
  <p>But</p>
  
  <pre><code>var a = new Foo();
  console.log ( a.getBar() );
  </code></pre>
  
  <p>returns undefined.</p>