maybe someone can help me out with the order of events in my tic tac toe game. My problem: The evaluation of the game takes place before the X or O is set in the field. I tried to register a 2nd click-event handler to make things right. They seem to be called in the right sequence:
- function turnPlayed, which should set the X or O
- the anonymous .click function, which evaluates the game state
In the console.log, you can see that the order is ok. However, the win/lose alert comes before the symbol is set. I hope, this does not sound as confused as I feel right now. However, it should become clear, if you try to lose a game:
Thanks in advance for your help!