0
I’m trying to assign an ID to each object in my array, but when I have two or more similar objects, they end up getting the same ID.
I’ve tried to do indexOf()
and also did not work.
this.selection.selected.forEach(servico => {
servico.id = this.contador;
this.adicionados.push(servico);
this.contador++;
});
List with different objects - List with 1 repeated object