Tic Tac Toe - Not taking turns!


#1

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.


#2

The browser debug console reports:

Uncaught ReferenceError: compId is not defined

On line 101 of your JS, if you change:

turns[compId] = computer;

to:

turns[id] = computer;

The computer will start taking turns as expected.


#3

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