What I am trying to do is take an array within an object within an array within an object (I know my data structure is ridiculous, any help with that would be great also) and convert the last array into an object with a "key":"value". I'm using Angular 1.5.7 if there is anything in Angular that could help do this. I know that probably makes no sense. I couldn't figure out a way to say what I am trying to do clearly so let me show you:

I start with an object like this:

```
{"instructor":[{"instructor_emails":[ "test@test.com","tester@tester.com"]}]}

```

And I want it to be:

```
{"instructor":[{"instructor_emails":{ "email":"test@test.com","email":"tester@tester.com"}}]}

```

I tried a couple of things and the closest I found was:

```
instructor.instructor_emails.map(function(e) {
        return { email: e };
});

```

But it doesn't quite do what I'm trying to do... Any thoughts?