Tic Tac Toe - Not taking turns!


Here is my pen: https://codepen.io/adampinsky/pen/PjMXNQ?editors=0011

I can’t determine what is causing my code to refuse the computer its turn.
Any help please.


The browser debug console reports:

Uncaught ReferenceError: compId is not defined

On line 101 of your JS, if you change:

turns[compId] = computer;


turns[id] = computer;

The computer will start taking turns as expected.


Thank you! you’ve helped me get past that hurdle!
Now on to the next. :wink: