javascript - lodash - create a unique list based on multiple attributes : <p>My collection looks like this. </p>

<pre><code>  var list = [{id:'12345', sequence:null}, {id:'12346', sequence:null}, {id:'12347', sequence:null}, {id:'12348', sequence:1}, {id:'12348', sequence:2}, {id:'12349', sequence:1}, {id:'12349', sequence:1}];
</code></pre>

<p>I am trying to get a unique list so that object with same id AND sequence will only return one of the objects (we have 2 here- {id:'12349', sequence:1})</p>

<p>my code</p>

<pre><code>  var uniqueList = _.uniq(list, function(obj) {
    return obj.id &amp;&amp; obj.sequence;
  });
</code></pre>

<p>can we use lodash uniq like this? what is the approach to fix this issue?</p>
