Three ways you can find the largest number in an array using JavaScript
Sonya Moisset
49126

  1. what is actually challenging here?
  2. as someone alreday wrote, approaches #1 and #2 are wrong. input array may contain only negative numbers, but your solution will return zeros.
  3. in addition, #1 works only for input array with 4 subarrays
  4. please test before you commit ;)