title: Sort array of objects with Lodash sortBy instead of custom sort function
body: <p>I have the following data:</p>
  
  <pre><code>phones: {
    'home': {
      number: '1234567890',
      primary: false,
      preferred: false
    },
    'mobile': {
      number: '2134567890',
      primary: true,
      preferred: true
    },
    'work': {
      number: '1234567809',
      primary: false,
      preferred: true
    }
  }
  </code></pre>
  
  <p>I'm passing this to a React component:</p>
  
  <pre><code>render: function() {
    return (
      &lt;MyComponent data={
        Object.keys(phones)
          .reduce((prev, key) =&gt; [...prev, phones[key]], []) // omitting keys
          .sort(this.sortPhoneNumbers)
        } 
      /&gt;
    )
  }
  </code></pre>
  
  <p>And this is my custom sort function:</p>
  
  <pre><code>sortPhoneNumbers: function (a, b) {
    if (a.preferred === b.preferred) {
      return (b.primary - a.primary)
    } else if (a.preferred &lt; b.preferred) {
      return 1
    } else if (a.preferred &gt; b.preferred) {
      return -1
    } else {
      return 0
    }
  }
  </code></pre>
  
  <p>I want to use <a href="https://lodash.com/docs/4.17.4#sortBy" rel="nofollow noreferrer">Lodash sortBy function</a> instead though.</p>