Question: I have an array of **position** and nested **user** objects like so:

```
[ 
  position: {
    title: Developer,
    user: { name: Albert }
    },
  position: {
    title: CEO,
    user: { name: Smith }
    }
] 

```

How do I get an array of [user, user] with Angularjs?

Answer: 
Assuming this is pseudo-code (as it's missing a few `{` and `}` and you'd need variables called Developer, Albert, CEO & Smith - I've fixed these in the *working example*) you can use [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map):

```
var arr = [{ 
  Position0: {
    title: Developer,
    user: { name: Albert }
    },
 {
  Position1 : {
    title: CEO,
    user: { name: Smith }
    }
}];
var result = arr.map(function(val, idx) {
    return val["Position" + idx].user.name;
});

```

[Working Example](http://jsfiddle.net/6dfjq0ov/)
Use `angular.forEach()`:

```
var arr1=[]
var arr=[ 
  position: {
    title: Developer,
    user: { name: Albert }
    },
  position: {
    title: CEO,
    user: { name: Smith }
    }
];
angular.forEach(arr,function(value,key){
   arr1[key]=value.position.user;
});
console.log(arr1);

```