title: Filter data from array Angular 2
body: <p>I have 2 <code>arrays</code> and I want to filter data based on column value. I am using below code but It is not working.<br/></p>
  
  <pre><code>const result = data.map(data1 =&gt; {
              return Object.assign({}, data1, this.data2.filter(data2 =&gt; data2.Id !== data1.Id)[0]);
          });
  </code></pre>
  
  <p><strong>Data 1 :</strong></p>
  
  <pre><code>[
    {
      "id": 2,
      "name": "data 2",
    },
    {
      "id": 3,
      "name": "data 3",
    }
  ]
  </code></pre>
  
  <p><strong>Data 2 :</strong></p>
  
  <pre><code>[
    {
      "id": 2,
      "name": "data 2"
    },
    {
      "id": 3,
      "name": "data 3"
    },
    {
      "id": 4,
      "name": "data 4"
    }
  ]
  </code></pre>
  
  <p>It should return below output.</p>
  
  <pre><code>[
  {
      "id": 4,
      "name": "data 4"
  }
  ]
  </code></pre>
  
  <p>How do I solve this ?</p>