I have an array of objects :
let formInputs = [
{"name" : "NOM_MANDATAIRE", "fieldType": "input", "type": "text", "values": []},
{"name" : "SECTEUR_VENTE", "fieldType": "select", "type": null, "values": [
{"key": "1", "value": "text of the select"},
{"key": "2", "value": "text of the select"}
]},
{"name" : "TITRE_VERSION", "fieldType": "input", "type": "text", "values": []},
];
I use a forEach to get each objects and manipulate them :
formInputs.forEach(element => {
console.log(element.name);
...
for (let items in element.values) {
for (item in items) {
console.log(item.key);
}
}
}
My issue is that i'm stuck when I want to retrieve the object associated to the key "values". In the forEach block i also tried to use a for each :
item returns 0 and item.key returns undefined.