title: Add only unique objects to array
body: <p>I have object created by function:</p>
  
  <pre><code>$scope.checkPosRole = function(possition , posRole , posFunction) {
     var rolePos = {pos: possition, posRole: posRole, posFunction: posFunction}; 
     $scope.rolePossition.push(rolePos);
     };
  </code></pre>
  
  <p>The problem is that I want to in the array was only 1 object with the specified value of <code>pos</code>. In the case when the object is added with value <code>pos</code> that exists already in the array I want to swap new object with object exist already in array. </p>
  
  <p>I've tried every function call scan the tables with <code>foreach</code>, but did not bring me desirable effect. Please help.</p>