Answers for "write a function that takes an array of numbers and returns the sum of the numbers."

1

sum of array of number

const sum = [1, 2, 3].reduce((partialSum, a) => partialSum + a, 0);
console.log(sum); // 6
 Run code snippet
Posted by: Guest on February-07-2022

Code answers related to "write a function that takes an array of numbers and returns the sum of the numbers."

Code answers related to "Javascript"

Browse Popular Code Answers by Language