let index = 0 for (let button of document.getElementsByTagName("button")) { const column = index % 7 button.addEventListener("click", () => dropPiece(game, column)) // TODO: write a dropPiece function index++ }