Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

246
Vistas
is it possible to find an object from an array and return an object not his reference?

is it possible to find an object from an array and return an object not his reference?

let found = this.clonedAllIconsMatching.find((obj) => obj.id == header.id);

the found variable is a reference I need to have an object, I want a copy of the object, and I want to change only the properties of the found object, not the object contained in the array.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you are using ES2018, you can use spread syntax: {...obj}. Otherwise, you can iterate through and copy the keys and values:

// obj is the object to clone
var o = {}; // The copy
for(var i in obj){
    o[i] = obj[i];
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda