ES6 Learning

by rough cheap

HTML

<h1>
ES6 Learning
</h1>

JavaScript

window.count = 10;

var Counter = function() {
	this.count = 0;
};

Counter.prototype.increment = function() {
	setTimeout(() => {
  	this.count++;
    console.log(this.count);
  }, 1000);
};

var counter = new Counter().increment();