title: Angular2 foreach object?
body: <p>I have an Array of Objects called comments, and I'm trying to select only one's that have the id of post that I need to another array of objects. And the problem is that I can't find a way to copy the object I have found. This is my function:</p>
  
  <pre><code>comments = [];
  commentspart = [];
  private loadPartComments(id){          
              this.comments.forEach(element =&gt; {
              if (element.postId == id) {
                  this.commentspart = ????;
                  }
              });
              return this.commentspart;
          }
  </code></pre>
  
  <p>Thank you.</p>