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

194
Vistas
Possible to get a reference to the value (location) of a js object key?

JS DOESN'T have pointers - but it does have references. I have a solution to my issue which I can post if anyone is interested, but I'm wondering if there is a better way...

Is there any way in JavaScript to get a "reference" to where an object key points? For example:

let anobj = {
  a: "aval",
  b: {
    bprime: "target",
  },
  b: "bval",
  c: "cval"
};

let bptr = getReference(anobj.b.bprime);
bptr = "Updated";

// So that anobj would then be:

{
  a: "aval",
  b: {
    bprime: "Updated",
  },
  b: "bval",
  c: "cval"
};

... or something equivalent. I mean, some way to have a variable/function that represents a deeply nested "location" in an object - that can be used to assign a new value to that node of the original object.

Sorry if that's not a clear expression of my question - it's very clear in my head...

about 4 years ago · Juan Pablo Isaza
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