.length = items in array
[0,1,2,3]
array length is 4 items
4 = arr.length
.length = items in array
[0,1,2,3]
array length is 4 items
4 = arr.length
Thanks for asking that - I was so confused when var j suddenly appeared!
Great challenge!
Math works like this:
I got this using these codes:
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (i = 0; i < arr.length; i++) {
for (j = 0; j < arr[i].length; j++) {
console.log(product *=arr[i][j]); // consolidates the value of [i] and [j] and assign it to **product**
}
}
// Only change code above this line
return product;
}
// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (var i = 0; i < arr.length; i++) {
for (var j = 0; j < arr[i].length; j++) {
product *= arr[i][j];
}
}
// Only change code above this line
return product;
}
// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
To the @narendra67 @thelynguist @wansim… you made my day to move on for next steps … personally thank you guys