Update the Board

Learn how to update the board.

What we have

We know the user’s input and have to place a marker on that index.

Requirements of this module

The function updateBoard() will perform the following tasks:

  • Receive three parameters: board, move, and currentPlayer.
  • Update the board by placing the marker on it.
  • Assign the array’s index the user’s symbol (X or O).

Try it yourself

All the functions are already defined. You just have to implement the given function and execute the code.

Get hands-on with 1400+ tech skills courses.