How to merge two array value matching by key value using Node.js/Javascript : I need one help. I need to match two array and merge by matching key value using Javascript/Node.js. I am explaining my code below.

    var userData=[{'email':'a@gmail.com','name':'Raj'},{'email':'b@gmail.com','name':'Rahul'}];
    var userData1=[{'email':'a@gmail.com','address':'abcdf'},{'email':'b@gmail.com','address':'bbsr'}];

Here I have two array and I need to merge both array by matching the `email` value and the expected output is like below.

    var finalArr=[{'email':'a@gmail.com','name':'Raj','address':'abcdf'},{'email':'b@gmail.com','name':'Rahul','address':'bbsr'}];

Please help me to do this.


