I have one object:
Object { name: " ", email: " " }
and another:
Object { name: Array[x], email: Array[y]}
and I want union like:
Object { name: {" ", Array[x]}, email: {" ", Array[y]} }
concat() can be used to merge multiple arrays together. But, it does not remove duplicates.
To merge duplicate objects in array of objects with JavaScript, we can use the array map method. to merge the items with the label value together. To do this, we get an array of labels without the duplicates with [... new Set(data.
You could use jQuery.extend to achieve your desire.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With