I am trying to multiply child array elements. Can you please have a look below code and let me know if we can do more optimization.
Note:- I want to push the multiplied value of child arrays in another array.
Can you please help me with this.
var arr1 = [
[3, 2],
[2, 3],
[4, 5]
]
var sumArr = [];
for (var row = 0; row < arr1.length; row++) {
var fullRow = arr1[row];
var val = 1;
for (var col = 0; col < fullRow.length; col++) {
val *= fullRow[col];
}
sumArr.push(val);
}
console.log(sumArr);