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

278
Views
how to store a variable and its value in data-structure?
let v = {a:1}
let s = new Set();
s.add(v);
v = null;

at this time , s still has one element : {a:1} enter image description here

I guess v and {a:1} are stored in different places, but I need an authoritative theory to explain this . it seems about heap and stack?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

let v = {a:1}
let s = new Set();
s.add(v);
v.b = 2;

at this time , s has one element : {a:1,b:2}.

However, I've learned ,v and {a:1} are two different things.

if set b = null,just change the pointer that b point to .

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