title: Why is "this" in an ES6 class not implicit?
body: <p>I know that ES6 solved a lot of problems that existed with the <code>this</code> keyword in ES5, such as arrow functions and classes.</p>
  
  <p>My question relates to the usage of <code>this</code> in the context of an ES6 class and why it has to be written explicitly. I was originally a Java developer and I come from a world where the following lines of code were perfectly natural.</p>
  
  <pre><code>class Person {
    private String myName;
  
    public Person() { 
      myName = "Heisenberg";
    }
  
    public void sayMyName() {
      System.out.println("My name is " + myName);
    }
  }
  </code></pre>
  
  <p>The compiler will always refer to the value of the field <code>myName</code>, unless it has a local variable with the name <code>myName</code> defined in the scope of the method.</p>
  
  <p>However, once we convert this code to ES6:</p>
  
  <pre><code>class Person {
  
    constructor() {
      this.myName = "Heisenberg";
    }
  
    sayMyName() {
      console.log(`My name is ${myName}`);
    }
  }
  </code></pre>
  
  <p>This won't work and it will throw an <code>Uncaught ReferenceError: myName is not defined</code>. The only way to fix this is to throw in an explicit <code>this</code> reference:</p>
  
  <pre><code>console.log(`My name is ${this.myName}`)
  </code></pre>
  
  <p>I understand the need for <code>this</code> in the constructor since ES6 classes don't allow your fields to be defined outside of the constructor, but I don't understand why the Javascript engines can't (or won't, because of the standard) do the same as Java compilers can in the case of <code>sayMyName</code></p>