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

119
Views
Trying to merge a Javascript object and an array

I am trying to merge a Javascript array and object to get one result.

Here is my code:

let allPlans = plans.map((p) => ({
    ...p,
    subscription: subscription?.filter(
      (s) => p.id == s.price.id
    ),
  }));

The error I am getting is TypeError: subscription.filter is not a function

Plans is an array and subscription is an object.

about 4 years ago · Santiago Gelvez
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!