Give an multi-dimensional array, starting from the first row, traverse the array by skipping every next row and calculate the sum of traversed elements and return it.
function traverseArray(arr){
// write your code here
}
let arr1 = [[1,2,3],
[4,5,6],
[7,8,9]];
let arr2 = [[1,2,3,4],
[5,6,7,8],
[9,10,11,12],
[13,14,15,16]];
console.log(traverseArray(arr1));// should return 30
console.log(traverseArray(arr2));// should return 52