arrow function used within an object literal
why does arrow function cause an issue - this.make and this.model are undefined but "normal" function(){} when used, theres no issue of undefined properties in the object literal
let car = {
make: 'bmw',
model: '745li',
year: 2020,
getPrice: () => {
//perform some calc
return 5000;
},
printDescription: () =>
{
console.log(this.make, this.model) <- undefined with arrow functions
}
};