setMaxWinnings : function( value ) { // This works fine: // this.maxWinnings = value; }
No, it doesn't. You've written a setter method that you need to call (like sgd.setMaxWinnings(10))
, but if you want a property assignment setter then you will need to use
set maxWinnings( value ) {
this._maxWinnings = value;
}