I've two type to data structures

```
   var dataA = [
  {
    "Employee Name": "Mr. X",
    id: "1"
  },
  {
    "Employee Name": "Mr. Y",
    id: "2"
  },
  {
    "Employee Name": "Mr. Z",
    id: "3"
  }
];

var dataB = [
  {
    id: "1",
    "Portfolio Lead": "A"
  },
  {
    id: "2",
    "Portfolio Lead": "B"
  },
  {
    id: "4",
    "Portfolio Lead": "D"
  }
];

```

Now I'm comparing the `id` value of both the array's and adding the `"Portfolio Lead"` property to `dataA`.

Below is the code,

```
function mergeTwoArray() {
  dataA.forEach(row => {
    dataB.forEach(lead => {
      if (lead["id"] === row["id"]) {
        row["Portfolio Lead"] = lead["Portfolio Lead"];
      }
    });
  });
  console.log(dataA);
}

```

Issue is,

When the `id` did not match, I need to add `"Portfolio Lead"` as `#NA`. If I try to add the if statement all the objects are adding `"Portfolio Lead"` as `#NA`.

Please tell me what I'm doing wrong here.

stackBlitz link <https://stackblitz.com/edit/typescript-nypqge?file=index.ts>

**Output should be**

```
var dataA = [
  {
    "Employee Name": "Mr. X",
    id: "1",
    "Portfolio Lead": "A"
  },
  {
    "Employee Name": "Mr. Y",
    id: "2",
    "Portfolio Lead": "B"
  },
  {
    "Employee Name": "Mr. Z",
    id: "3",
    "Portfolio Lead": "#NA"
  }
];

```