hello! I'm trying to add numbers from an array. I went with the .reduce method, however it's not working. It keeps giving me a result of 0. I console logged the array, and indeed the values are there. Why isn't it doing the addition then?
const cubitMeters =
(parseInt(height) * parseInt(width) * parseInt(length) * parseInt(count)) / 1000000
totalW.push(cubitMeters)
const totalW = []
const sum = totalW.reduce((a, b) => a + b, 0)
console.log('sum: ' + sum)
console.log(totalW)