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

81
Views
Consecutive destructure statement issue

I want to remove the user_id field from 2 different objects but get a compile error. what is the correct way ?

const  { user_id, ...userLessId } = user


const { user_id, ...zombieLessId } = existingZombieUser
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to assign these variables to different names, otherwise your user_id will be defined twice, which cause an SyntaxError.

const  { user_id: user_id1, ...userLessId } = user

const { user_id: user_id2, ...zombieLessId } = existingZombieUser

You have to avoid the SyntaxError, so you can also reassign just one variable:

const { user_id, ...userLessId } = user;
const { user_id: zombieUserId, ...zombieLessId } = existingZombieUser;
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!