Is there a way to efficiently merge two arrays by name, even if one array has "Ana Marie Cruz" while the other has "Anna Marie"? I've tried doing it in ES6 but can't seem to figure it out. Any suggestions on the best approach?
let arr1 = [{
name: "Shaina",
age: "27"
}, {
name: "Ana Marie Cruz",
"age": "35"
}];
let arr2 = [{
name: "Ana Marie",
status: "married"
gender: Female
}];
I'm attempting to achieve the following output in JavaScript:
var arr3 = [{name: "Shaina", age: "27"},{name:"Ana Marie Cruz", age: "35",status:"married",gender:Female}];