I'm trying to get the total of an array passed via a console log. However instead of adding the numbers it's returning the array with a 0 in front.
This is what I have tried
const sum2 = (array) => {
let total = 0;
const totalFigure = array.reduce((total, number) => {}, 0)
return total + array
}
console.log(sum2([1, 3, 5, 7, 9]));