function createRange(start, end) {
var numbers = [];
for (var i = start; i < end + 1; i += 1)
numbers.push(i);
return numbers;
function calculateSum() {
numbers.reduce(function (a, b) {
return a + b;
}, 0);
}
};
console.log(createRange(5, 15));
console.log(calculateSum());
Could someone explain why I'm not getting the sum of numbers? The sum keeps showing as 0.