I'm writing a simple tic tac toe game, and I'm trying to check for different win states. The different tiles are set up in an array, so to check for a win for the three top spaces I have
if (tableArr[0].hasClass('userTaken') && tableArr[1].hasClass('userTaken') && tableArr[2].hasClass('userTaken')){
select(); //ends game
}
I'm looking for a way to shorten this, I tried tableArr[0,1,2].hasClass('userTaken') but that didn't work. Any suggestions?