I'm trying to build this JSON : 

```
{
    "id": 20,
    "professions":
    [
        {
            "id_profession": 3853
        },
        {
            "id_profession": 3854
        }
    ]   
}

```

And my function is the next : 

```
submitRegistration(value: Object): void {

        let nameGroup = value['name'];
        let type = value['type'];
        let sectorTemp: Sector = value['sectors'];

        let listProfessions: ProfessionGroup[];       
        let addProfessions: AddProfesions;

        (value['professions']).forEach(i=>{
            console.log(i.id);
            let oneProffesion:ProfessionGroup;
            oneProffesion.id_profession=i.id;
            listProfessions.push(oneProffesion);
        })

        console.log(listProfessions.length);       
    }

```

`value['professions']` return an object list and I need to get the id only . 

The problem is that it allways return :

Cannot set property `'id_profession'` of `undefined`

In the loop foreach and I don't know why, I've tried to initialize it with null but doesn't function.

My interfaces are : 

```
export interface Profession {
    id: number;
    name: string;
}

export interface ProfessionGroup {
    id_profession: number;
}

export interface AddProfesions{
    id:number;
    professions:ProfessionGroup[];
}

```