JSFiddle - React, Tailwind, and code Playground

by skirtle

JavaScript

class Game {
  constructor () {
    this.board = []
  }
  
  get board () {
    return this._board
  }
  
  set board (newBoard) {
    console.log('assigning a new board!', newBoard)
    this._board = newBoard
  }
}

const game = new Game()

game.board = undefined