JS version of Tic-tac-toe