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

164
Views
Spread operator "is not defined" when trying to omit property

I'm new to react, i'm trying to do something that should be very simple: use the spread operator (...) to create a copy of an object OMITTING ONE PROPERTY...

I've tried to follow some posts here, when i test then in javascript emulator they work, but they dont work in my real case

const obj = { a : 'a', b : 'b', c : 'c'};
const [formData, setFormData] = useState({a,...obj});

console.log(formData);

I get the error

Uncaught ReferenceError: a is not defined

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!