Tic Tac Toe (Testing Stuff)

This was only created as a test for creating a simple Tic Tac Toe game using pure JavaScript.

by Officer_Erik_1K88

HTML

<h1>Tic Tac Toe</h1>
<div id="content">
    <p id="winner">In Game</p>
    <button id="reset" onclick="reset()">Reset</button>
    <p><span id="pl">Player 1</span>'s Turn</p>
    <div id="board">
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
        <div class="cell"></div>
    </div>
</div>

CSS

#reset {
    display: none;
}

#board {
    display: inline-grid;
    grid-template-columns: auto auto auto;
    background-color: #bfbfbf;
    gap: 10px;
    padding: 10px;
}

.cell {
    border: 1px solid rgba(0, 0, 0, 0.8);
    padding: 80px;
    background-color: #e8e8e8;
    cursor: pointer;
}

JavaScript

const data = { // All the data of the game
    gameSet: "In Game", // For stating who won the game or if it ended in a draw, is to be stated as "In Game" when the game is still in session
    nextTurn: true, // What player is playing (true for player 1, while false is for player 2)
    filledCells: [ // The script representation of the cells
        [false,""], // Cell 1
        [false,""], // Cell 2
        [false,""], // Cell 3
        [false,""], // Cell 4
        [false,""], // Cell 5
        [false,""], // Cell 6
        [false,""], // Cell 7
        [false,""], // Cell 8
        [false,""], // Cell 9
        false // This is only true if all cells are filled
    ],
    pieces: ["X","O"], // The pieces
    winCond: [ // The win conditions
        [0, 1, 2],
        [0, 3, 6],
        [0, 4, 8],
        [1, 4, 7],
        [2, 4, 6],
        [2, 5, 8],
        [3, 4, 5],
        [6, 7, 8]
    ]
};

var cellItems = document.querySelectorAll('.cell'); // The call for all the cells
var winner = document.getElementById("winner"); // The call to the winner display
var plCall = document.getElementById("pl"); // The call to the player's turn display

function endGame(winnr) { // This function ends the game
    if (winnr==data.pieces[0]) { // If winnr equals 'X' then Player 1 wins
        data.gameSet = "Player 1 Won";
    } else if (winnr==data.pieces[1]) { // If winnr equals 'O' then Player 2 wins
        data.gameSet = "Player 2 Won";
    } else if (winnr=="XO") { // If winnr equals 'XO' then nether Player wins
        data.gameSet = "Draw";
    }
    winner.innerHTML = data.gameSet; // Sets the winner display to display who won
    document.getElementById("reset").style.display = "inline"; // Displays the reset button
}

function checkForWin() { // This is the function that checks for wins/draw
    for (let on=0; on<data.pieces.length; on++) {
        var onThis = data.pieces[on];
        var love = 0;
        for (let i=0; i<data.winCond.length; i++) {
          ...