Uncaught TypeError: Cannot set property playerNo of # which has only a getter on line 4

You have recursion with setting playerNo.

In the playerNo setter, try setting this._playerNo = 0.

In the rest of the code, continue to make a distinction between the name of the setter method and the internal property that stores the data.

Leave a Comment