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

121
Views
I dont understand this destructuring case in Javascript

I have this in a project's code, but I dont understand it:

const values = {
  value1: 30,
  value2: 60
}

let {
  value1: red,
  value2: blue
} = values;

console.log(red);

In the second part I tought that value1 was being declared as a variable but it seems that is the oposite, red gets 30 (value1) ¿? Why is 'red' receiving value1?

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!