Pinewood Technologies interview question

Create an AI for Tic-Tac-Toe using JavaScript.