Tell us what’s happening:
Your code so far
function largestOfFour(arr) {
var result = [];
for (var n =0; n< arr.length; n++) {
var Large = arr [n][0];
for (var sb = 1; sb <arr[n].length; sb++) {
if (result[n][sb] > Large ){
Large = val[n][sb];
}
}
result[n] = Large;
}
return val;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
** Interesting!!!**
Code is looking the same as https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays/ but have another variables and my code get error while that one is working… HOW AND WHY?