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

87
Views
Dynamic property destructuring doesn't work for numbers

I'm trying to remove a dynamic property from myObject (in a react project). Here is myObject:

myObject = {
 'property1': {},
 'property2': {},
 '3': {}
}

This is what I tried:

const {[prop]:removedItem, ... rest} = myObject;

the problem is that it doesn't work when prop = '3' ,it works when prop = 'property1' though.

Any ideas where I'm making a mistake?

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!