title: es6 Javascript class using this inside a callback
body: <p>The new es6 class allows you to use the self reference variable <code>this</code> inside methods.<br/>
  However if a class method has a sub function or a callback, that function/callback no longer has access to the self reference variable <code>this</code><br/></p>
  
  <pre><code>class ClassName {
    constructor(dir){
      this.dir = dir;
      fs.access(this.dir, fs.F_OK | fs.W_OK, this.canReadDir);//nodejs fs.access with callback
    }
  
    canReadDir(err){
      this.dir;// NO ACCESS to class reference of this
    }
    //OR
    aMethod(){
      function aFunc(){
        this.dir;// NO ACCESS to class reference of this
      }
    }
  }
  </code></pre>
  
  <p>Is there any solution to this?</p>