I've been working on a simple Tic Tac Toe game in JavaScript.  It runs the way it should, but the Board.checkWin function (check every possible winning combo) could be better, it is very repetitive in its current state.  Any ideas?Here is my Cell class:var Cell = function() {this.value = |_|;};Cell.prototype.setState = function(arg) {    this.value = arg;};Cell.prototype.playable = function() {    if (this.value == |_|) {        return true;    } else {        return false;    }};Cell.prototype.render = function() {    return this.value;};Here is my Board class:var Board = function() {    this.cells = [];    this.currentPlayers = [|X|,|O|,|X|,|O|,|X|,|O|,|X|, |O|, |X|];     this.winner = this.currentPlayers[1];};Board.prototype.startGame = function() {    for (i = 0; i < 9; i++) {        this.cells.push(new Cell);    }    return this.render();};Board.prototype.makePlay = function(position) {    if (this.checkWin() == false) {    if (position < this.cells.length) {        var cell = this.cells[position];        var currentPlayer = this.currentPlayers.shift();        if (cell.playable() == true) {        cell.setState(currentPlayer);        }    }       return this.render();    }};Board.prototype.checkWin = function() {for(var i = 0; i < this.cells.length; i++)    if (this.cells[0].value == |X| && this.cells[1].value == |X| && this.cells[2].value == |X|    ||        this.cells[0].value == |O| && this.cells[1].value == |O| && this.cells[2].value == |O| ||        this.cells[3].value == |X| && this.cells[4].value == |X| && this.cells[5].value == |X| ||         this.cells[3].value == |O| && this.cells[4].value == |O| && this.cells[5].value == |O| ||         this.cells[6].value == |X| && this.cells[7].value == |X| && this.cells[8].value == |X| ||        this.cells[6].value == |O| && this.cells[7].value == |O| && this.cells[8].value == |O| ||         this.cells[0].value == |X| && this.cells[3].value == |X| && this.cells[6].value == |X| ||         this.cells[0].value == |O| && this.cells[3].value == |O| && this.cells[6].value == |O| ||         this.cells[1].value == |X| && this.cells[4].value == |X| && this.cells[7].value == |X| ||         this.cells[1].value == |O| && this.cells[4].value == |O| && this.cells[7].value == |O| ||         this.cells[2].value == |X| && this.cells[6].value == |X| && this.cells[8].value == |X| ||         this.cells[2].value == |O| && this.cells[6].value == |O| && this.cells[8].value == |O| ||         this.cells[0].value == |X| && this.cells[4].value == |X| && this.cells[8].value == |X| ||         this.cells[0].value == |O| && this.cells[4].value == |O| && this.cells[8].value == |O| ||         this.cells[6].value == |X| && this.cells[4].value == |X| && this.cells[2].value == |X| ||         this.cells[6].value == |O| && this.cells[4].value == |O| && this.cells[2].value == |O|)        {            return true;        } else {            return false;    }};Board.prototype.render = function() {    var boardArray = [];    for (var i = 0; i < this.cells.length; i++) {        boardArray.push(this.cells[i].value);    }    for (var j = 0; j < boardArray.length; j++) {        var boardString = TIC TAC TOE  + boardArray[0] + boardArray[1] + boardArray[2] + \n ;        boardString +=  PICK A BOX  + boardArray[3] + boardArray[4] + boardArray[5] +  \n ;        boardString +=    0 THRU 8  + boardArray[6] + boardArray[7] + boardArray[8];    }    if (this.checkWin() == true) {        return boardString + \n   WE HAVE A WINNER!;    } else {    return boardString;         }};
JavaScript Tic Tac Toe - functional but could be DRYer
javascript;tic tac toe