I have two arrays
var array1 = [{firstName:'John', age:32, email:'xyz1@email.com'}, {firstName:'Jack', age:40, email:'xyz2@email.com'}];
var array2 = [{firstName:'Jen', age:29, email:'abc1@email.com'}, {firstName:'Jack', age:40, email:'xyz2@email.com'}];
I would like to merge the two arrays and get the below output
var array3 = [{firstName:'John', age:32, email:'xyz1@email.com'}, {firstName:'Jack', age:40, email:'xyz2@email.com'}, {firstName: 'Jen', age: 29, email: 'abc1@email.com'}];
Would like to know best way to merge two arrays in JavaScript so that I get only the unique items from each array?