TicTacToe Switch Statement ?help

I want to start my tictactoe in a simple way. i haven’t wrapped my head around minimax algorithms yet.

I want to use a simple switch statement for Os move. Basically, I want the ‘AI’ to go through the block in a set order looking to see if x is there. if x is there move to the next. if x isnt there o goes there and switch statement breaks. i cant seem to figure out the coding for this. if anyone can help please do.

my game -http://codepen.io/benjaminadk/full/wdXogb/

edit - i m also trying if else but thats not working great either