title: JavaScript class without this, that, self, etc
body: <p>Is it possible to create JavaScript class without using 'this' keyword? Expressions like</p>
  
  <pre><code>var self = this;
  ...
  self.property = value;
  </code></pre>
  
  <p>is also prohibited. I dont want to think about context and use only vars.</p>
  
  <p>Take a look at this simple class:</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>function Timer() {
    var interval = 0;
    var count = ++Timer.totalCount;
  
    function setInterval(val) {
      interval = val;
    }
    function run() {
      setTimeout(done, interval);
    }
    function done() {
      var div = document.createElement('div');
      div.innerHTML = 'Timer #' + count + ' finished in ' + interval + ' ms';
      document.body.appendChild(div);
    }
  
    return {
      setInterval: setInterval,
      run: run
    }
  }
  Timer.totalCount = 0;
  
  var t1 = new Timer();
  var t2 = new Timer();
  var t3 = new Timer();
  
  //how to directly set interval value without set function?
  t1.setInterval(3000);
  t2.setInterval(2000);
  t3.setInterval(1000);
  
  t1.run();
  t2.run();
  t3.run();</code></pre>
  </div>
  </div>
  </p>
  
  <p>This class does not use 'this' at all. </p>
  
  <p>Is it correct? </p>
  
  <p>Can I create real classes like that? Is there potential problems?</p>
  
  <p>How to create property in this class without get/set function?</p>
  
  <p>Is that class possible to extend using inheritance?</p>