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

310
Views
How to get difference values between an array of values and array of object using lodash

I have two array as

a1 = ['test1@gmail.com','test2@gmail.com','test3@gmail.com'];
a2 = [{email: 'test1@gmail.com'},{email: 'test2@gmail.com'}];

Now I want to get difference between these two array mentioned above as

resultDifference = ['test3@gmail.com'];

How to achieve this difference result by using lodash only.

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

0

You should add what you have tried to your post

const a1 = ["test1@gmail.com", "test2@gmail.com", "test3@gmail.com"];
const a2 = [{ email: "test1@gmail.com" }, { email: "test2@gmail.com" }];

const ans = _.difference(
  a1,
  a2.map((a) => a.email)
);
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!