From: Carl Worth Date: Mon, 1 Jun 2020 14:25:53 +0000 (-0700) Subject: tictactoe: Use empty strings instead of null objects for empty squares X-Git-Url: https://git.cworth.org/git?p=empires-server;a=commitdiff_plain;h=4a744b0425333284979ef76206c457ff7dcf5907 tictactoe: Use empty strings instead of null objects for empty squares So that the data in the board array is always of a consistent type. --- diff --git a/tictactoe.js b/tictactoe.js index 1f559bd..f9b357b 100644 --- a/tictactoe.js +++ b/tictactoe.js @@ -7,7 +7,7 @@ class TicTacToe extends Game { constructor(id) { super(id); this.moves = []; - this.board = Array(9).fill(null); + this.board = Array(9).fill(""); } /* Returns Boolean indicating whether move was legal and added. */