nesting for loops
let arr = [
[1,2], [3,4], [5,6]
];
for (let i=0; i < arr.length; i++) {
for (let j=0; j < arr[i].length; j++) {
console.log(arr[i][j]);
}
}
nesting for loops
let arr = [
[1,2], [3,4], [5,6]
];
for (let i=0; i < arr.length; i++) {
for (let j=0; j < arr[i].length; j++) {
console.log(arr[i][j]);
}
}
nesting for loops
function multiplyAll (arr){
var product = 1;
for(var i=0; i < arr.length; i++ ){
for(var j=0; j < arr[i].length; j++){
product *= arr[i][j];
}
}
return product;
}
var product = multiplyAll([[1,4], [5,9], [7,2,4]]);
console.log(product);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us