function expandShown(board, elCell, i, j) {
    //var minesCount = 0;
    var cell = board[elCell.i][elCell.j];

    for (var m = cell.i - 1; m <= cell.i + 1; m++) {

        if (m < 0 || m >= gBoard.length) continue;
        for (var n = cell.j - 1; n <= cell.j + 1; n++) {

            var innerCell = board[m][n];

            if (m === cell.i && n === cell.j) continue;
            if (n < 0 || n >= gBoard[0].length) continue;
            else {
                if (!innerCell.isMarked && !innerCell.isShown) {
                    var tempElCell = getClassName(innerCell);
                    var elCurrCell = document.querySelector(`.${tempElCell}`);
                    elCurrCell.style = "background-color: rgb(150, 149, 149)"
                    gState.shownCount++;
                    innerCell.isShown = true;
                    //console.log('shown count:', gState.shownCount);

                    if (innerCell.minesAroundCount !== 0) {

                        elCurrCell.innerText = `${innerCell.minesAroundCount}`;
                    }
                    if (innerCell.minesAroundCount === 0) {

                        expandShown(gBoard, innerCell, m, n)
                    }
                }
            }
        }
    }
    // CR: Unnecessary return.
    return;
}
// CR: The function receives i and j arguments but they never used.
The function receives i and j arguments but they never used.
The function receives i and j arguments but they never used .
function expandShown(board, elCell, i, j) {
    var cell = board[elCell.i][elCell.j];
    for (var m = cell.i - 1; m <= cell.i + 1; m++) {
        if (m < 0 || m >= gBoard.length) continue;
        for (var n = cell.j - 1; n <= cell.j + 1; n++) {
            var innerCell = board[m][n];
            if (m === cell.i && n === cell.j) continue;
            if (n < 0 || n >= gBoard[0].length) continue;
            else {
                if (!innerCell.isMarked && !innerCell.isShown) {
                    var tempElCell = getClassName(innerCell);
                    var elCurrCell = document.querySelector(`.${tempElCell}`);
                    elCurrCell.style = "background-color: rgb(150, 149, 149)"
                    gState.shownCount++;
                    innerCell.isShown = true;
                    if (innerCell.minesAroundCount !== 0) {
                        elCurrCell.innerText = `${innerCell.minesAroundCount}`;
                    }
                    if (innerCell.minesAroundCount === 0) {
                        expandShown(gBoard, innerCell, m, n)
                    }
                }
            }
        }
    }
    return;
}
function expandShown ( board , elCell , i , j ) { var cell = board [ elCell . i ] [ elCell . j ] ; for ( var m = cell . i - 1 ; m <= cell . i + 1 ; m ++ ) { if ( m < 0 || m >= gBoard . length ) continue ; for ( var n = cell . j - 1 ; n <= cell . j + 1 ; n ++ ) { var innerCell = board [ m ] [ n ] ; if ( m === cell . i && n === cell . j ) continue ; if ( n < 0 || n >= gBoard [ 0 ] . length ) continue ; else { if ( ! innerCell . isMarked && ! innerCell . isShown ) { var tempElCell = getClassName ( innerCell ) ; var elCurrCell = document . querySelector ( ` ${ tempElCell } ` ) ; elCurrCell . style = "background-color: rgb(150, 149, 149)" gState . shownCount ++ ; innerCell . isShown = true ; if ( innerCell . minesAroundCount !== 0 ) { elCurrCell . innerText = ` ${ innerCell . minesAroundCount } ` ; } if ( innerCell . minesAroundCount === 0 ) { expandShown ( gBoard , innerCell , m , n ) } } } } } return ; }
CR: The function receives i and j arguments but they never used.
CR : The function receives i and j arguments but they never used .
//var minesCount = 0; //console.log('shown count:', gState.shownCount); // CR: Unnecessary return.