Question: I'm trying to get second object inside `data` if this id is equals with the id of another object.

With the code below, I'm able to get only ID and not the whole

```
data: {
0: {
    id: 1234,
    name: 'Name 1'
},
2: {
    id: 4321,
    name: 'Name 2'
},
3: {
    id: 876,
    name: 'Name 3'
 }
}
instanceID: 4321

constructor(props) {
super(props);

this.state = {
    defaultInstance: 0
}
}

fetch('api)
.then(response => {
console.log('Data fetched', response);

this.setState({
    defaultInstance: [response.data.indexOf(response.data.find((instance) => instance.id ===   response.instanceID))]
});
});

```

So, what I want to achieve is to add to the `defaultInstance` that object

```
2: {
    id: 4321,
    name: 'Name 2'
},

```

Answer: 
Try this :

```
defaultInstance: response.data.filter(d=> d.id == response.instanceID)

```
This will help you.

```js
let data = {
0: {
    id: 1234,
    name: 'Name 1'
},
2: {
    id: 4321,
    name: 'Name 2'
},
3: {
    id: 876,
    name: 'Name 3'
 }
};
let instanceID = 4321;

let result = Object.values(data).filter(chunk => chunk.id === instanceID);
console.log(result);
```