title: validate if there are multiple index on array javascript angularjs
body: <p>so I have this array</p>
  
  <pre><code>array = [
  {id:1,value:1},
  {id:2,value:1},
  {id:1,value:2},
  {id:1,value:3},
  {id:2,value:2},
  {id:1,value:4},
  {id:2,value:3}
  ]
  </code></pre>
  
  <p>I want to sort it out and make an output like this </p>
  
  <pre><code>array = [
  {id:1,value:4},
  {id:2,value:3}
  ]
  </code></pre>
  
  <p>I want to achive that using javascript, or is angularjs have the ability to do this ? thank you.</p>