Returning largest number in an array challenge

hi guys.i literaly broke this challenge down. in other to solve it bit by bit.but at this time i am stuck.what next are my supposed to do,to pass the challenge

  **Your code so far**

function largestOfFour(arr) {
let largestNumber = [0,0,0,0];
for (let arrayIndex = 0; arrayIndex < arr.Length; arrayIndex++) {
 for (let subArray = 0; subArray < arr.Length; subArrayIndex++) {

return  largestNumber;

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; rv:97.0) Gecko/20100101 Firefox/97.0

Challenge: Return Largest Numbers in Arrays

Link to the challenge:

Two questions

  1. Why are these loops separate?

  2. Where is your logic to find big numbers?

i did not know the two loops could actually be together.but i have corrected it.talking about logic to find big number do you mean creating an array that will hold the big numbers??

How do you find the largest number from a list when you look at it? With your eyes. What do you think and do?

i will look through the list of the numbers then figure out the numbers with the highest digit

Say it’s 500 numbers long. How do you keep track of which is biggest?

i will start looking for the large to the largest number

I don’t understand what that means. I couldn’t use that description to teach myself how to find the biggest number in a long list.

The digit with highest left most digit is largest number . If there are more than one numbers with same leftmost digit, Then see the second leftmost digit of these numbers, the number with highest number at second left place will be largest.

Sure, I can compare two numbers and find the biggest, but how do I compare 500?

I don’t not understand your question

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.