title: Remove duplicate items in objects array with lodash.js
body: <p>I'm trying to remove duplicate items using <a href="https://lodash.com/docs" rel="noreferrer">lodash.js</a> but I can't make it works properly.</p>
  
  <p>This is the structure of an object in the array:</p>
  
  <pre><code>{
     label: 'tagA',
     value: 1
  }
  </code></pre>
  
  <p>So let say I have this array:</p>
  
  <pre><code>var objectsArray = [
    {
      label: 'tagA',
      value: 1
    },
    {
      label: 'tagB',
      value: 2
    },
    {
      label: 'tagC',
      value: 3
    },
    {
      label: 'tagB',
      value: 4
    },
    {
      label: 'tagB',
      value: 5
    },
  ];
  </code></pre>
  
  <p>I made this piece of code with <a href="https://lodash.com/docs#uniqBy" rel="noreferrer">_.uniqBy()</a> function from lodash.js to try to remove the elements of array with the same labels, but it dosn't work as I expected:</p>
  
  <pre><code>    var uniq = _.uniqBy(objectsArray, function(o){
          return o.label;
      });
  </code></pre>
  
  <p>I based on some sample found here and there and lodash documentation of course but I have a lack of knowledge in this regard so any help it will super appreciate it.</p>
  
  <p>Thanks.</p>