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

117
Views
why is dispatch() is adding additional property 'undefined'

I am manipulating an obj, so that it can be dispatched using redux, by using foll code.

const objMap = {};
const propList = ['apple', 'banana'];

for (const prop of propList) {
   objMap[prop] = 0;
}
console.log("thunk2: ", materialMap);
dispatch(reduxActions.updateCount({ objMap }));

without dispatch(); line of code, result is

{
  "apple": 0,
  "banana": 0,
}

but when dispatch() is used then result is as below with extra property 'undefined'

{
    "apple": 0,
    "banana": 0,
    "undefined": null
}

why is 'undefined' being added?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I revisited my code and it's a logical error. Not an issue with dispatch() api itself.

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!