title: Converting function to es6 class
body: <p>I am working on learning how to use es6 <code>class</code> and need some help in understanding how this would be converted from a <code>function</code> to a <code>class</code>:</p>
  
  <pre><code>function MyModel(make, year) {
      var carType = this;
  
      carType.make = make;
  
      // function that I have further in code
      sellCar(carType, year);
  }
  </code></pre>
  
  <p>What I am trying to accomplish is something like this:</p>
  
  <pre><code>class MyModel {
    constructor(make, year) {
      this.make = make;
      this.year = year;
  
      sellCar(this.make, this.year);
    }
  }
  </code></pre>
  
  <p>What I get confused about is what I do about the reference I have to <code>this</code> that I reference from the variable. Do I need that? I use that in other parts of my code, but would rather refactor to not do so.</p>
  
  <p>The sticky point for me right now is assigning <code>this</code> to carType. If I put the code below in my <code>constructor</code>, how do I point a reference to <code>this</code> from <code>carType</code>?</p>