JSFiddle - React, Tailwind, and code Playground

by Danny Michaelis

JavaScript

class Player {	
  constructor (x=0) {
		this.id: x,
    this.units: {}, //{id: unit}
    this.tiles: [], //[id]
    this.points: 0,// number
  }
  
  addPoints(additionalAmount) {
  	this.points += additionalAmount;
  } 
}

const p = new Player(1234);

console.log(Object.getOwnPropertyNames(p))
console.log(Object.getPrototypeOf(p))