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

289
Views
How reference value types in Javascript works?

I'm learning Javascript, based on my knowledge that the reference type like object below is created in the heap, and point to a new piece of memory in the stack. But what happened when I've tried to declare an object like this:

let object = { id: 1223, title: 'test' };

and when I reassigned it:

object = { newId: object.id, newTitle: object.title };

I got:

object = { newId: 1223, newTitle: 'test' };

I'm so curious as to why this is possible, Has the property name gone when I reassigned the object? and How it works behind the screen?

Please give me some explanations, keywords, or documents.

Many thanks.

P/s. Something I forgot is that the = operator's associativity happened from right to left, so the object at this point was not mutated until the execution met the =. Maybe it is the answer for my question somehow.

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!