var numbers = [10, 20, 30, 40]
var sum = 0;
for (var i = 0; i < numbers.length; i++) { sum += numbers[i]}
const years = [1, 2, 3, 4]
let total = 0;
for (let i = 0; i < years.length; i++) {
total += years[i]
}
console.log(total)
//answer willl be 10
const numbers = [10, 20, 30, 40]
add = (a, b) => a + b
const sum = numbers.reduce(add)