I am currently working on a task that involves summing up all the numbers in each array and displaying the total sum of that specific array. Unfortunately, I am facing challenges in figuring out how to achieve this functionality through my code.
For example:
var myArray = [123, 456, 789]
My aim is for the program to output 6, 15, 24.
This means adding up each individual number within the array: 1+2+3=6, 4+5+6=15, and 7+8+9=24.
I would greatly appreciate some guidance on how to approach this problem of adding every single number in the input array.