I'm creating a simple tic-tac-toe game and I'm currently trying to store the user's checks into variables. The problem is, with my current code the xMoves and oMoves arrays are returning Void 0. What's wrong with this code? http://jsfiddle.net/Z6StP/
var storeMoves = function () {
if (currentPlayer === X) {
xMoves.push(cellTracker);
} else if (currentPlayer === O) {
oMoves.push(cellTracker);
}
};
cellTracker
is undefined in that function.