Javascript – error:Cannot set property author of #<xxx> which has only a getter. But if I change the getter function name, this error disappears
When the class has only one getter and no setter, it will report an error, but if I change the name of the getter, the error will disappear. The code that will report an error: class Book { constructor(author) {…