I read this on w3schools that:-
https://www.w3schools.com/js/js_arrow_function.asp
"In regular functions, the 'this' keyword represented the object that called the function, which could be the window, the document, a button or whatever."
"With arrow functions, the 'this' keyword always represents the object that defined the arrow function."
var name = "ABC";
var obj =
{
name: "abc",
func: () => {
console.log(this.name);
}
};
obj.func();
So here, 'this' in the arrow function should be representing 'obj' object, but the output is "ABC", whereas according to me it should be "abc", there should be some concept that I am not aware of right now?