title: best way to get a specific object from and array without looping
body: <p>In one of the controllers of my angular application i have a variable set as follows.</p>
  
  <pre><code>SomeService.get({}, function(data){
      // this sets xyz as the list of the data retrieved 
      // from the resource within the controllers scope
      $scope.xyz = data.objects;    
  });
  </code></pre>
  
  <p>Now <code>$scope.xyz</code> looks something like</p>
  
  <pre><code>[
      0: {id: 1, ...more data here ...},
      1: {id: 2, ...more data here ...},
      2: {id: 3, ...more data here ...},
      3: {id: 4, ...more data here ...},
      4: {id: 5, ...more data here ...},
      5: {id: 6, ...more data here ...},
  ]
  </code></pre>
  
  <p>What i am trying to do is get an object within xyz using the <code>id</code> property (not the list index). I am aware that I can iterate over the array as follows.</p>
  
  <pre><code>angular.forEach($scope.xyz, function(obj){ return obj.id == 1;});
  </code></pre>
  
  <p>but is there a way I can do it without looping over the list ?</p>