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

184
Views
JS: Removing Object from json array with array

im trying to remove from my JSON file one object from the array:

let json = [{
              "name":"John",
              "age":"29"
             },
             {
              "name":"Billy",
              "age":"45"
           }];

I have an array that has the data to remove from JSON, it only has name in it

let remObj = ['John'];

Is it possible to remove only using name?

Edit:
I have tried Slice, Splice and filter

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

0

Does this work for you?

let json = [{
              "name":"John",
              "age":"29"
             },
             {
              "name":"Billy",
              "age":"45"
           }];

let remObj = ['John'];

const newJson = json.filter(p => !remObj.includes(p.name))
console.log(newJson)

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!