I am a beginner in javascript. Can someone explain the use of 'this' keyword in the following code and why the code doesn't work without the 'this' keyword?
function Count() {
var count = 0;
this.incrementCount = () => {
count++;
console.log(count);
};
this.decrementCount = () => {
count--;
console.log(count);
};
}
var count1 = new Count();
count1.incrementCount();
count1.decrementCount();