+ 1
Can someone explain me what the code below means?
function multiplyAll(arr) { let product = 1; for (var i = 0; i < arr.length; i++) { for (var j = 0; j < arr[i].length; j++) { product = product * arr[i][j]; } } return product; } multiplyAll([[1, 2], [3, 4], [5, 6, 7]]);
1 Answer
+ 3
It multiplies together each subarray and returns the product