How can I set the .innerHTML for multiple indexes of an array? I currently have an array
let poles = Array.prototype.slice.call(document.querySelectorAll(".pole"));
This array contains 9 empty divs, such as :
<div class="pole" id="1"></div>
When a user clicks on one of these divs, it will display either X or O since it is for a tic-tac-toe game.
I want to achieve something like this :
poles[0][1][2].innerHTML ==='X'
or
poles[0, 1, 2].innerHTML === 'X'
Instead of having to write out every condition individually:
if(poles[0].innerHTML === 'X' && poles[1].innerHTML === 'X' && poles[2].innerHTML === 'X')