// how to add numbers in an array in javascript let number = [10, 20, 40]; let result = number.reduce((a, b) => a + b); console.log(result); // 70