title: How to get index of array element in loop?
body: <p>I have an loop Angular JS:</p>
  
  <pre><code>angular.forEach($scope.message, function (item) {
        return (item.id_user == input.id_user) ? true : false;
  }); 
  </code></pre>
  
  <p>How to get index of array element in loop for each <code>item</code>?
  I tried:</p>
  
  <pre><code>angular.forEach($scope.message, function (item, $index) {});
  </code></pre>