Simple Javascript for tick-tac-toe game(PVT course)