“Encontre objetos duplicados no Array JS” Respostas de código

Encontre objetos duplicados no Array JS


let arr = []
arr.push({place:"here",name:"stuff"});
arr.push({place:"there",name:"morestuff"});
arr.push({place:"there",name:"morestuff"});


arr = arr.filter((value, index, self) =>
                 // return if the index if the matched innerr iteration matches the index of the outer iterator
  index === self.findIndex((t) => (
    t.place === value.place && t.name === value.name
  ))
)
eje sunday

Encontre objetos duplicados no Array JS

let arr = []
arr.push({place:"here",name:"stuff"});
arr.push({place:"there",name:"morestuff"});
arr.push({place:"there",name:"morestuff"});


arr = arr.filter((value, index, self) =>
// return if the index if the matched innerr iteration matches the index of the outer iterator
  index === self.findIndex((t) => (
    t.place === value.place && t.name === value.name
  ))
)
eje sunday

Respostas semelhantes a “Encontre objetos duplicados no Array JS”

Perguntas semelhantes a “Encontre objetos duplicados no Array JS”

Mais respostas relacionadas para “Encontre objetos duplicados no Array JS” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código