title: Checking of duplicate value in JSON object array
body: <p>I have this json object which has seq 1,2,3,4. And in the main HTML page, user can edit the seq number and I need to make sure that every seq is unique and must not repeat like 2 set of "1" &amp; "1".
  Unfortunately, it is buggy and sometimes it works sometimes not.
  Can someone point out my mistake? I want to ignore blank value as well</p>
  
  <pre><code>$scope.myDataset.map(v =&gt; v.seq).sort().sort((a, b) =&gt; {
      if (a !== '' &amp;&amp; b !== '' &amp;&amp; a === b) {
          $scope.duplicateFound = true
      }
  })
  
  $scope.myDataset = [
      { seq: '1', },
      { seq: '2', },
      { seq: '3', },
      { seq: '4', },
      { seq: '', },
      { seq: '', },
  
  ];
  </code></pre>