I know arrow functions don't have its own 'this' and references its parents and thus I assumed it to be pointing to its parent's 'this' i.e. obj. Would really appreciate if someone could answer this.
var obj = {
fullname: 'Jack',
prop: {
fullname: 'John',
getFullname: () => {
return this.fullname;
}
}
};
console.log(obj.prop.getFullname()); // undefined, as this is window not obj or prop
var test = obj.prop.getFullname;
console.log(test()); // undefined