I'm trying to assign an ID to each object in my array, but when I have two or more like objects, they end up getting the same ID.
I already tried to indexOf()
and it 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