function addMines(level, board, currCell) {

    var addedMines = [];
    for (var x = 0; x < gLevel[level].MINES; x++) {
        
        // CR: Each cell has class name with i and j,
        // CR: so keep using it and don't switch to x and y.
        // CR: Use variable names like randI and randJ.
        var random1 = getRandomNumber(gLevel[level].SIZE);
        var random2 = getRandomNumber(gLevel[level].SIZE);
        
        for (var y = 0; y < addedMines.length; y++) {
            //console.log('added mine:', addedMines[y], 'added mines:', addedMines);

            if (addedMines[y].i === random1 && addedMines[y].j === random2) {
                random1 = getRandomNumber(gLevel[level].SIZE);
                random2 = getRandomNumber(gLevel[level].SIZE);

            }
        }
        var cell = board[random1][random2];
        cell.isMine = true;
        addedMines.push(cell);
    }

}
// CR: The function receives a currCell argument but it never used.
The function receives a currCell argument but it never used.
The function receives a currCell argument but it never used .
function addMines(level, board, currCell) {
    var addedMines = [];
    for (var x = 0; x < gLevel[level].MINES; x++) {
        var random1 = getRandomNumber(gLevel[level].SIZE);
        var random2 = getRandomNumber(gLevel[level].SIZE);
        for (var y = 0; y < addedMines.length; y++) {
            if (addedMines[y].i === random1 && addedMines[y].j === random2) {
                random1 = getRandomNumber(gLevel[level].SIZE);
                random2 = getRandomNumber(gLevel[level].SIZE);
            }
        }
        var cell = board[random1][random2];
        cell.isMine = true;
        addedMines.push(cell);
    }
}
function addMines ( level , board , currCell ) { var addedMines = [ ] ; for ( var x = 0 ; x < gLevel [ level ] . MINES ; x ++ ) { var random1 = getRandomNumber ( gLevel [ level ] . SIZE ) ; var random2 = getRandomNumber ( gLevel [ level ] . SIZE ) ; for ( var y = 0 ; y < addedMines . length ; y ++ ) { if ( addedMines [ y ] . i === random1 && addedMines [ y ] . j === random2 ) { random1 = getRandomNumber ( gLevel [ level ] . SIZE ) ; random2 = getRandomNumber ( gLevel [ level ] . SIZE ) ; } } var cell = board [ random1 ] [ random2 ] ; cell . isMine = true ; addedMines . push ( cell ) ; } }
CR: The function receives a currCell argument but it never used.
CR : The function receives a currCell argument but it never used .
// CR: Each cell has class name with i and j, // CR: so keep using it and don't switch to x and y. // CR: Use variable names like randI and randJ. //console.log('added mine:', addedMines[y], 'added mines:', addedMines);