1
Hello, I would like to know how to insert an element inside an object of an array, in this case, when I add with the code below, the element is inserted as another index:
this.array = [];
this.array.push(email);
this.array.push({ Mensagem: res.data[0].Mensagem });
The return I get is this one:
[
{
"CodigoPostagem": 25,
"DataMensagem": "2017-06-28T14:35:00",
"Emitente": "Item",
"Titulo": "Mensagem número 25",
"Visualizado": false
},
{
"Mensagem": "Teste"
}
]
The "email" has the above item, I just wanted to insert the return of an api inside that object.
Thank you in advance!
You want to add that object to
Mensagem
to the object ofemail
? that’s it?– Sergio