Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!