Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda