all files / test/ math.js

100% Statements 13/13
100% Branches 4/4
100% Functions 1/1
100% Lines 13/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                        
function min(a,b) {
    const c = 3;
    return (b -a) * c;
}
module.exports = {
    add: (...args) => {
        return args.reduce((prev,curr) => {
            return prev + curr;
        })
    },
    mul: (...args) => {
        return args.reduce((prev,curr) => {
            return prev * curr;
        })
    },
    cover:(a,b) => {
        if(a > b){
            return a-b;
        }else if(a === b){
            return a+b;
        }else {
            return min(a,b);
        }
    }
};