title: Filter array for angular2 + ngrx
body: <p>I am trying to use this filter in an angular+ngrx app:</p>
  
  <pre><code>fetchById(id: number): Document {
  
  return this.store.select( s =&gt; s.documents ).filter( obj =&gt; obj.id == id )[0]
  
   }
  </code></pre>
  
  <p><code>documents</code> is an array of <code>Documents</code>, and the latter have an <code>id</code> property. The idea is to filter the array to select one document.  However, I get this error message: </p>
  
  <p>Property <code>id</code> does not exist on type <code>Document[]</code>.  I don't understand the message, since <code>obj</code> is an element of the array, hence a certain object which has an id property.  Any ideas on what is wrong here? Thanks!</p>