title: Javascript reduce function/ternary operator
body: <pre><code>function largestInEach(arr) {
      var resultArray = [],
          highestValue = 0;
      for (var i = 0; i &lt; arr.length; i++) {
          highestValue = arr[i].reduce(function(a, b){
              return a &gt;= b ? a : b;
          });
          resultArray.push(highestValue);
      } 
      return resultArray;
  }
  </code></pre>
  
  <p>Can someone please explain this code. </p>
  
  <p>The rest of the code is very clear to me, but I have difficulty understanding the reduce function and its application.</p>