Merge Array of Objects by Property using Lodash
<p>I have two arrays of objects that represent email addresses that have a label and a value:</p>

<pre><code>var original = [
  {
    label: 'private',
    value: 'private@johndoe.com'
  },
  {
    label: 'work',
    value: 'work@johndoe.com'
  }
];

var update = [
  {
    label: 'private',
    value: 'me@johndoe.com'
  },
  {
    label: 'school',
    value: 'schhol@johndoe.com'
  }
];
</code></pre>

<p>Now I want to compare and merge the two arrays by the <code>label</code> field, so that the result would look like this:</p>

<pre><code>var result = [
  {
    label: 'private',
    value: 'me@johndoe.com'
  },
  {
    label: 'work',
    value: 'work@johndoe.com'
  },
  {
    label: 'school',
    value: 'schol@johndoe.com'
  }
]
</code></pre>

<p>How can I do this e.g. using <a href="https://lodash.com/" rel="noreferrer">lodash</a>?</p>