Why my code running wrong but it the same with the hint , help pls ! Im just newbie


My work in Basic algorithm scripting
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays/

it same the hint but why it running not properly

when you post your code could you post the actual code instead of a screenshot? people that have slow connection would not be able to help you, plus it is easier to copy your code to do debugging in a code editor or quote specific code snippets to point where the issues are

thanks , i will follow your reply,I will do it in next time :grinning:

can you explain for me the different between my code and the hint pls! because i think the both is right but it seem not :heart_eyes:

follow the value that DaiKFD get through the code
If you post your code instead of a screenshot, someone would be able to help you better, as I said above.

yes, thanks i will follow your word :slight_smile:

I am asking my for you to write your code, instead of a screenshot, because in this way it would be pretty simple to copy your code to debug it, right now it is possible just to go by intuition of what could possibly be wrong

You are setting the DaiKFD variable to 0 and testing against it. What if the largest number is a negative number?.

The hint code is setting the variable to the value of the first element in each of the nested arrays.

var largestNumber = arr[n][0];
// vs
DaiKFD = 0;

tks so much bro :slight_smile: