DEV Community

Oscar Hernandez
Oscar Hernandez

Posted on

SumAllRange

function sumAll(arr) {
var a = arr[0]; var b =arr[1];
var n = (a+b+a+b);
var p = (a+b);
for(let i=0; i if(p<=5){
arr = n;
}if(p>10){
arr = p+n;
}
console.log(arr)
return arr;
}
}
sumAll([1, 4]);

?signin=true

Top comments (0)