I currently have an object called "Sorteio" which contains a vector of objects named "Resultado", consisting of 6 Resultados. The way I am creating instances of them is as follows:
saveSorteio() {
var data = {
loteria: this.sorteio.loteria,
resultados: [
{
valor: this.sorteio.resultados[0].valor,
animal: this.sorteio.resultados[0].animal
},
{
valor: this.sorteio.resultados[1].valor,
animal: this.sorteio.resultados[1].animal
},
/* ... */
]
};
}
Is there a different method to instantiate all 6 at once, or do I need to continue calling index by index?