Closed ASPzoomin closed 1 year ago
Hmmm... Wouldn't this mean there's a winner before the game has begun? Because at the start all of those values will be empty. The first
squares[a]
check is to make sure that it has a value.
right but wondering in what scenario there would be a winner before the game start?
I think you code makes that possible which is what I'm saying.
I think you code makes that possible which is what I'm saying.
makes sense, but we don't call checkwinner function until we click the square button my code will not make it possible in this case, but i get your point!!
squares[a] && squares[a] === squares[b] && squares[a] === squares[c]