0

I've two arrays in angular2 like below

a[]=[{"alice",12},{"bob",15}];
b[]=[{"alice",12},{"james",16}];

How can i compare above two array using angular2 approach. I need both values like matched value and unmatched values in angular2.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • you mean you need the intersection and difference of the arrays? – toskv Nov 21 '16 at 08:54
  • yes , almost like that –  Nov 21 '16 at 08:54
  • 1
    I would suggest you get an utility library like lodash to do that for you. – toskv Nov 21 '16 at 08:55
  • 1
    What does this have to do with Angular? Or TypeScript for that matter? Angular is not a programming language. Generalized deep diffing is a complicated problem, but you could start off with a search for "deep comparison objects javascript". –  Nov 21 '16 at 11:19

0 Answers0