Why I'm getting an undefined? So I think this is a problem inside the arrow functions...
I need to amke it work by the arrow function inside the method say
const obj = {
a: 42,
say: () => {
console.log(this.a);
}
};
obj.say();
windowor the enclosing context doesn't haveafunctioninstead of an arrow function. In arrow functionsthisreferences the function. (tryconsole.log(this)).this. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…