title: Converting duplicate items in array into unique items without removing any item in Javascript
body: <p>I have an array with list of items.Some items are duplicates.I need the way to make those items as unique.I know of using track by $index in ng-repeat of angularjs.But i want to use the array without trackby.as a regular ng-repeat. </p>
  
  <pre><code>Array=[
          { name:'john',salary:'2000'},{ name:'john',salary:'2000'},{ name:'john',salary:'2000'},{ name:'harry',salary:'2000'}]
  </code></pre>
  
  <p>Is there any way I can do it in controller of the angularjs.I tried adding new field to the array Like this:</p>
  
  <pre><code>for(x in Array){
   Array[x].unique=x;
    }
  </code></pre>
  
  <p>But it givessame value to all the duplicate items.
  Any way to resolve this.</p>