here are two simple codes:
let myObject = {
objectName: () => {
console.log(this);
}
};
myObject.objectName();
First code print "this" value as: { }
let myObject = {
objectName: function() {
console.log(this);
}
};
myObject.objectName();
Second code print "this" value as: { objectName: [Function: objectName] }
Can somebody explain in plain English why "this" in arrow function has different value ? Thank you!