+ 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]]);

2nd Feb 2022, 5:32 PM
Khant Htay
Khant Htay - avatar
1 Réponse
+ 3
It multiplies together each subarray and returns the product
2nd Feb 2022, 5:39 PM
Sam