function checkWin(state, player) {
 	for(let group of WINNING_GROUPS) {
 		if (group.every(index => state[index] == player)) {
 			return group;
 		}
 	}
 }
/**
  * Checks if either player has won the game and shows victory
  * on baord if there is a winner.
  *
  * A win is when 3 squars line up in:
  * 	- one row
  * 		1,2,3
  * 		4,5,6
  * 		7,8,9
  * 	- one column
  * 		1,4,7
  * 		2,5,8
  * 		3,6,9
  * 	- diagonal (top left or top right)
  * 		1,5,9
  * 		3,5,7
  * 
  * @return {Boolean} true means game is over, false means continue
  */
Checks if either player has won the game and shows victory
on baord if there is a winner.



@return {Boolean} true means game is over, false means continue
Checks if either player has won the game and shows victory on baord if there is a winner . @return { Boolean } true means game is over false means continue
function checkWin(state, player) {
 	for(let group of WINNING_GROUPS) {
 		if (group.every(index => state[index] == player)) {
 			return group;
 		}
 	}
 }
function checkWin ( state , player ) { for ( let group of WINNING_GROUPS ) { if ( group . every ( index => state [ index ] == player ) ) { return group ; } } }
Checks if either player has won the game and shows victory
 on baord if there is a winner.
Checks if either player has won the game and shows victory on baord if there is a winner .