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

202
Views
Different behaviours when using var vs {var} in chrome.storage.sync.get

I am not able to understand how exactly the chrome.storage.sync.get function works.

Usual Scenario:

chrome.storage.sync.get(["color", "colortwo"], function(colors) {
    changeColor.style.backgroundColor = colors.colortwo
});

Special Scenario:

chrome.storage.sync.get(["color", "colortwo"], function({colortwo}) {
    changeColor.style.backgroundColor = colortwo;
});

I am not able to understand how specifying function({colortwo}) is able to let us access the colortwo variable directly since chrome.storage.sync.get is supposed to return an object containing all of our data

Would love some insights as to how exactly Javascript handles this special case so that I can gain a deeper understanding. Thanks!

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!