I Was Learning the OOP Javascript tutorial and the instructor used the same code I wrote and the output in the first print in console was you have discount and in the second one was you don't have discount while when I use it it prints you don't have discount in the both prints in console
note : the video I have watched have been published 2 years ago so I think that there are some updates that occured to this keyword in javascript which I don't know
I tried this code and it prints you don't have discount in both cases
let obj = {
hasDiscount: true,
showMsg: () => `You${this.hasDiscount ? '' : " Don't"} Have Discount`
}
console.log(obj.showMsg())
let newOne = Object.create(obj);
newOne.hasDiscount = false;
console.log(newOne.showMsg())