I need help solving an equation that involves adding numbers from a list of randomly generated arrays, following the indices.
Each array in the list consists of four fixed-length random numbers:
const list = [
[2, 9, 1, 2],
[2, 3, 9, 4],
[4, 7, 8, 1]
]
My goal is to calculate the sum of each number at every index across all arrays. For example:
const list = [
[2, 9, 1, 2],
[2, 3, 9, 4],
[4, 7, 8, 1]
]
// Expected Result: [8, 19, 18, 7];
Can you provide guidance on how to accomplish this task?