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

402
Views
Warning: Array.prototype.reduce() expects a return value from arrow function
const singleParams = [...appliedFilters].reduce((prev, curr) => {
    if (curr.key !== "multi")
        return { ...prev, ...curr.selectedValue.params };
    return;
}, {});

The following function is giving me the following warning in my console.

Line 22:13: Array.prototype.reduce() expects a return value from arrow function array-callback-return

I can't ignore it since I won't be able to deploy with warnings. How do I fix it?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to return prev in else block

  const singleParams = [...appliedFilters].reduce((prev, curr) => {
        if (curr.key !== "multi")
            return { ...prev, ...curr.selectedValue.params };
        return prev;
    }, {});
about 4 years ago · Santiago Trujillo 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!