Even and odd

Report a typo

In the code below you have a function named sumTheArrays. It will receive an object with the following structure:

{
  'even': [...],
  'odd': [...]
}

Each array will have 5 integers in it. Your task is to sum each of the respective odd and even numbers by their index, and return the result in a single array of size 5.

Sample Input 1:

{"even":[2,4,6,8,10],"odd":[1,3,5,7,9]}

Sample Output 1:

[ 3, 7, 11, 15, 19 ]
Write a program in JavaScript
function sumTheArrays(naturalNumbers) {
return ...;
}
___

Create a free account to access the full topic