I have an array object that I want to add a key and value in it.
I tried something like:
this.testeobj//meu objeto
this.testeobj[0].push({oi: 'teste});
I have an array object that I want to add a key and value in it.
I tried something like:
this.testeobj//meu objeto
this.testeobj[0].push({oi: 'teste});
You want an array of objects
this.testeobj = [] //seu array de objetos
this.testeobj.push({oi: 'teste});
The push is a property only of the array, it will insert in the last position of your array the past value that in your case is an object.
The example below passing the position is only when you want to put the value in the exact position of the array
this.testeobj[0] = {oi: 'teste};
I hope I have helped