For this Question: Given an array Arr of N integers, your task is to print the sum of elements present at even places and print the product of elements present at the odd places.

Note:- Consider the first element to start from 1.The first line of input contains a single integer N, the next line of input contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= N <= 50
1 <= Arr[i] <= 5Print the sum of elements present at even places and print the product of elements present at the odd places separated by a space.Sample Input:-
5
1 2 3 4 5

Sample Output:-
6 15

Explanation:-
Sum = 2 + 4
Product = 1*3*5

Sample Input:-
2
4 6

Sample Output:-
6 4, I have written this Solution Code: function altSumProduct(arr, n) {
  let sum = 0;
  let prod = 1;
  arr.forEach((el, idx) => {
    if (idx % 2 !== 0) {
      sum += el
    } else {
      prod *= el
    }
  })
  console.log(`${sum} ${prod}`)
}, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?