here is a sample example where there are two arrays and we have a merge() to which we pass the arrays. the merge() should return the merged array such that it should merge the objects which have same name.
let arr1 = [ { name: "Person1", age: 20 }, { name: "Person2", age: 30 } ] let arr2 = [ { name: "Person1", email: "[email protected]" }, { name: "Person3", age: 25 } ] arr3 = merge(arr1, arr2) output : arr3 should be : [ { name: "Person1", age: 20, email: "[email protected]" }, { name: "Person2", age: 30 }, { name: "Person3", age: 25 } ]
mergefunction? What specifically are you having problems with?name similar... similar or the same? the two words are not synonymous