title: Math.max returns null on variables?
body: <p>So I am building a piece of JavaScript code that returns an array of the largest numbers from each of the provided sub-arrays.</p>
  
  <pre><code>function largestOfFour(arr) {
  var array = [];
  for (i = 0; i &lt; arr.length; i++) {
  // return arr[i].join() on this line gives 4,5,1,3
  array.push(Math.max(arr[i].join()));
  }
  return array;
  }
  
  largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
  </code></pre>
  
  <p>My question is why the:
  <code>Math.max(arr[i].join())</code>
   returns a <code>null value</code>?</p>
  
  <p>If I return 
  <code>arr[i].join()</code>  on the previous line (as in code comment) it returns to me <code>4,5,1,3</code> for the 1st iteration. If I put in <code>Math.max(4,5,1,3)</code> it returns <code>5</code>which is what I want.</p>
  
  <p>Assigning the <code>arr[i].join()</code> to a variable and then putting in <code>Math.max</code> also returns <code>null</code>. I would run the<code>Math.max</code>through a reduce function, but it won't let me run a function through a loop.</p>
  
  <p>I'm sure there is a simple reason why this doesn't work, but I can't find an explanation anywhere. I don't need help with a solution to the overall problem - just help with understanding why the <code>Math.max</code> won't work.</p>