And for good measure, what I had thought they wanted and how I would've written it:
functiongetMaxOfAllArrays(groupOfArrays){varlargestNumberArray=[];varlargestNumber=0;// picking 0 to start// loop through our arraysfor(varwhichArray=0;whichArray<groupOfArrays.length;whichArray++){varcurrentArray=groupOfArrays[whichArray];// index change -- since we are no longer comparing within the array// we need to loop through the whole thing.for(varwhichNumber=0;whichNumber<currentArray.length;whichNumber++){varcurrentNumber=currentArray[whichNumber];if(currentNumber>largestNumber){largestNumber=currentNumber;// we can't stop here--what about the other arrays?}}}// return the maxreturnlargestNumber;}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
And for good measure, what I had thought they wanted and how I would've written it: