The right-hand side of your assignment, !this.isCheckedOut, gets the value of the .isCheckedOut property and returns the opposite by applying the logical not operator.
Presumably, the object has a property of ._isCheckedOut. It likely doesn’t have a property of .isCheckedOut, and I’m guessing you don’t have a setter method with that name either. As a result, this.isCheckedOut does not exist (because it’s not a valid property of the object nor a method of the object).
That’s what I think might be happening, but if you can point me at the exercise I can check and make sure.
Thank you for your explanation on the first part that I understood.
Finally which is the most correct writing for the right part of equality: without the “underscore” (which comes from the getter, if I’m not mistaken ) or with “underscore” (I think which is the property of the object recovered directly) ?
for the second question (about the first part of equality), there is a setter in the Media class, but I realize that I had made a typo in the name of this._isCheckedOut, so it’s like there isn’t indeed
This error rectified, whether I put “underscore” or not in front of isCheckedOut, it works correctly. Is it correct to say that this._isCHeckedOut will directly update the property of the Media class and that this.isCheckedOut will call the setter who will do it?
which is more correct?