The following code doesn't work:
let myClass = ()=>{
this.value = 2
return this
}
myClass.prototype.print = ()=>{
console.log(this.value)
}
While this works
let myClass = function(){
this.value = 2
return this
}
myClass.prototype.print = function(){
console.log(this.value)
}
What was the difference between ES6 function and regular function?