[Solved] how can i check winners by using jquery [duplicate]
$(document).ready(function() { let gameArray = []; let turn = 1; let gameOver = false; $(“#turn”).text(turn === 1 ? ‘X’ : ‘O’); $(“.smallbox”).click(function() { let squereIndex = $(this).attr(‘id’).replace(‘square’, ”) – 1; if (turn == 1 && !gameOver && gameArray[squereIndex] === undefined) { $(this).text(“X”); $(this).addClass(“X”); turn = 2; gameArray[squereIndex] = 1; } else if (!gameOver && gameArray[squereIndex] … Read more