I know that arrow functions don't have their own "this" keyword, and "this" will point to parent (if it has it). Can someone please explain why "this" in class points to class and why "this" in object points to global window? So question is about differences between class and object here.
In class:
class App {
getPosition = () => {
//this points to class App
};
getPosition2(){
//this undefined
}
}
Object:
const obj = {
someFunction: () => {
//this points to global window
}
someFunction2(){
//this points to object
}
};