I am currently experimenting with ECMA6 classes. My current class looks like the following
class Player { constructor(id) { this.id = id; this.cash
cash represents the getter/setter, _cash is the 'private' property.
set cash(value) { // line 19 this._cash = value; // line 20 }
Have a look at this page for a clear example.