Question: I have an array of objects which first array looks like

[![enter image description here](https://i.stack.imgur.com/9NMor.png)](https://i.stack.imgur.com/9NMor.png)

now in client side I want to create an index array and store the value projects in there but I am getting 8 `undefined` in the array

```
var roadsArr =[];
for (i = 1; i < 9; i++) { 
  roadsArr.push(data[1].ecolo_roads_Projects_Step_+[i]);    
}   

```

Can you please let me know what I am doing wrong?

Answer: 
This:

```
roadsArr.push(data[1].ecolo_roads_Projects_Step_+[i]);

```

You can't construct an immediate property name like that, you'd need:

```
roadsArr.push(data[1]['ecolo_roads_Projects_Step_' + i]);

```

That aside, if you have an ordered sequence of object members, consider using an actual array instead of an ad-hoc, brittle name-based mechanism.
Perhaps `data[1].ecolo_roads_Projects_Step_+[i]` should be: `data[1].ecolo_roads_Projects_Step_+i`