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

126
Vistas
Is there a language-level way to deep clone a JavaScript object?

Is there a language-level way to deep clone a JavaScript object that is supported by main browsers (desktop and mobile)? I've seen that eval(uneval(o)); is non-standard.

JSON.parse(JSON.stringify(o)); looks ugly. You don't fundemantally need to 'stringify' at the first place. Just copy the bytes from the object to somewhere else in the RAM. Anything done above this looks like an inefficiency to me.

I am surprised to see that there is not this kind of functionality in various languages...

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

0

All objects are actually clones of their respective prototypes...

There is a reason we have Object constructors. Meaning :: You can write an object constructor, and clone it as many times you as need to.

Of course this may not be the "language-level" way that you expect, but truly - that's the real procedural way JavaScript Objects are supposed to be created.

We don't do that because JavaScript is a relaxed language, meant to be programmer friendly and not a pain in the rear like they're trying to make it, so we forget our manners.

However, writing constructors for deep Objects is not an easy task at all. -But I'm pretty sure it is not all that impossible.

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