title: Getting the min and max value in JavaScript, but from a 2D array
body: <p>I know this gets asked again and again but hear me out - this question is slightly different. </p>
  
  <p>I can get a max or min from a 1D array like this:</p>
  
  <pre><code>var w_max = Math.max.apply(Math, myArray); 
  var w_min = Math.min.apply(Math, myArray); 
  </code></pre>
  
  <p>But my array is of the type:</p>
  
  <pre><code>[[[1, 112.0],[2,5.12],[3,113.1],[4,33.6],[5,85.9],[6,219.9]]]
  //max = 219.9, min = 5.12
  </code></pre>
  
  <p>and I need to get min and max of the second value, with the first value being an index of sorts. I've tried </p>
  
  <pre><code>myArray[][], myArray[0][0], myArray[[1]] 
  </code></pre>
  
  <p>and more. Console logging shows I'm getting NaN or -Infinity!! </p>