function areAllDead(array) {
    let numDead = 0;
    for (let i = 0; i < array.length; i++) {
        if (array[i].hpLeft == 0) {
            numDead++;
        }
    }
    if (array.length == numDead) {
        battleIsOver = true;
        return true;
    } else {
        return false;
    }
}
/**
 * Checks if all monsters in battle are dead.
 * @returns true if number equals array size, false if not.
 */
Checks if all monsters in battle are dead.
@returns true if number equals array size, false if not.
Checks if all monsters in battle are dead . @returns true if number equals array size false if not .
function areAllDead(array) {
    let numDead = 0;
    for (let i = 0; i < array.length; i++) {
        if (array[i].hpLeft == 0) {
            numDead++;
        }
    }
    if (array.length == numDead) {
        battleIsOver = true;
        return true;
    } else {
        return false;
    }
}
function areAllDead ( array ) { let numDead = 0 ; for ( let i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] . hpLeft == 0 ) { numDead ++ ; } } if ( array . length == numDead ) { battleIsOver = true ; return true ; } else { return false ; } }
Checks if all monsters in battle are dead.
Checks if all monsters in battle are dead .