Hey guys, so I’ve been solving the javascript tests and this one asks me to create nested loops. I type my code and run the test but apparently I just get a “time out”. It stops solving them and all my tests come out failed. The last version of my code is identical to the one of the tutorial video. Has anyone had this problem? It seems pretty weird that it would just say screw it bruh i’m not solving this, especially since the timeout comes up pretty early.
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (var i=0; i < arr.length; i++) {
for (var j=0; i < 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]]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
.
Challenge: Nesting For Loops
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops