I have an `items` object with data structured like this:

```
[
  {
    "date": "31/03/2019",
    "code": 10,
    "type": "submission",
    "performance": 95,
  },
  // Continues 100s of times
]

```

I am trying to create a new object called `performanceSeries` using some of these key/value pairs but in a different structure, to end up with this:

```
[
  {
    "id": "Performance",
    "data": [
      {        
        "x": "31/03/2019",
        "y": 95
      },
      // Continues 100s of times
    ]
  },
]

```

In my code I create the new object and then use a `forEach` loop to add in the `date` and `performance` key/value pairs from the original object. I am getting the right object structure, but I only get the last key/value pair from the original object, and nothing more (There should be 100s).

```
const performanceSeries = {
  id: "Performance",
  data: {}
};

Object.keys(items).forEach(function (key) {
  performanceSeries.data["x"] = items[key].date;
  performanceSeries.data["y"] = items[key].performance;
})

```