function validateInput(soldiersCount, troopsTypes) {
    if (soldiersCount != parseInt(soldiersCount)) {
        throw new inputValidationException('soldiersCount should be an integer');
    }

    if (soldiersCount < 1) {
        throw new inputValidationException('soldiersCount should be greater than zero');
    }

    if (soldiersCount < troopsTypes.length) {
        throw new inputValidationException('Army members can not be less than troops types');
    }
}
/**
 * Accepts soldiersCount and validate it against some conditions
 * @param soldiersCount
 * @param troopsTypes
 */
Accepts soldiersCount and validate it against some conditions
@param soldiersCount
@param troopsTypes
Accepts soldiersCount and validate it against some conditions @param soldiersCount @param troopsTypes
function validateInput(soldiersCount, troopsTypes) {
    if (soldiersCount != parseInt(soldiersCount)) {
        throw new inputValidationException('soldiersCount should be an integer');
    }
    if (soldiersCount < 1) {
        throw new inputValidationException('soldiersCount should be greater than zero');
    }
    if (soldiersCount < troopsTypes.length) {
        throw new inputValidationException('Army members can not be less than troops types');
    }
}
function validateInput ( soldiersCount , troopsTypes ) { if ( soldiersCount != parseInt ( soldiersCount ) ) { throw new inputValidationException ( 'soldiersCount should be an integer' ) ; } if ( soldiersCount < 1 ) { throw new inputValidationException ( 'soldiersCount should be greater than zero' ) ; } if ( soldiersCount < troopsTypes . length ) { throw new inputValidationException ( 'Army members can not be less than troops types' ) ; } }
Accepts soldiersCount and validate it against some conditions
 @param soldiersCount
 @param troopsTypes
Accepts soldiersCount and validate it against some conditions @param soldiersCount @param troopsTypes