title: Compare and reduce complex array of objects
body: <p>I have a ``dataset which is an <em>array of objects</em> for some items in a database that has the details of how long it will take in <code>estimatedDays</code> for a specific item to be shipped:</p>
  
  <pre><code>items : [
      {
      id: '1'
      shippingMethods: [
          {
          id: 'STANDARD',
          estimatedDays: 3,
          },
          {
          id: 'TWODAY',
          estimatedDays: 2,
          },
          {
          id: 'NEXTDAY',
          estimatedDays: 1,
          },
      ]
      },
      {
      id: '2'
      // same shipping data as above but standard shipping will take 4 estimatedDays
      },
      {
      id: '3'
      // same shipping data as above but TWODAY shipping will take 3 estimatedDays
      },
  ]
  </code></pre>
  
  <p>I am wondering if there is a reduce function that could compare each <code>shippingMethod.id</code> in each item and return a new array back only where <code>shippingMethod.estimatedDays</code> is greatest compared to all items.</p>
  
  <p>So the end array would be an array of objects with (in this case) 3 shipping methods: STANDARD, TWODAY, and NEXTDAY.</p>