why are my numbers concatenation and not adding up?
function sumAll(arr) {
var ans = arr.reduce(function(a, b){
var min = Math.min(a, b);
var max = Math.max(a, b);
var result = "";
for( min = min;min <= max; min++){
result += min;
}
return result;
});
return ans;
}
sumAll([1, 4]);