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

157
Views
Remove Sub Element Using lodash

I have an array that looks like this.

0: {source: 'source0', value: 'value0', path: 'path0'}
1: {source: 'source1', value: 'value1', path: 'path1'}
2: {source: 'source2', value: 'value2', path: 'path2'}

I'd like to use lodash to return the array without the path element but can't seem to get it figured out. TIA.

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

0

Try the delete operator in Vanilla JS

const objArr = [
    {source: 'source0', value: 'value0', path: 'path0'},
    {source: 'source1', value: 'value1', path: 'path1'},
    {source: 'source2', value: 'value2', path: 'path2'},
]

objArr.forEach(obj=>{
    delete obj.path
})

console.log(objArr)
/* Now it looks like this:
[
  { source: 'source0', value: 'value0' },
  { source: 'source1', value: 'value1' },
  { source: 'source2', value: 'value2' }
]
*/
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!