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

193
Views
How to find and delete specific item in nested array of objects using JavaScript filter method?

I have just started learning JavaScript, I am wondering what is the easiest and right way to find and delete specific element by id in the array of nested object.

I want to delete item from this data by specific ID.

my code

const initialData = [
  {
    title: 'lover',
    data: [ { uId: 392928377430992 }, { uId: 39292837743099 } ],
  },
  {
    title: 'lover2',
    data: [ { uId: 392928377431244 }, { uId: 392928377413213 } ]
  },
];

const newArray = initialData.map((el) => { return el.data });
const findInNewArray = newArray.filter((el) => { return el.uId != 392928377413213 });
console.log(findInNewArray);

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!