I have two arrays that I want to merge into each other but I cannot seem to figure out how to NOT override the properties with the same value/id/number.
What I have now:
First array
0: {id: 1, title: "Button", type: "Controls & Inputs"}
1: {id: 2, title: "Switch", type: "Selection Controls"}
2: {id: 3, title: "Tags", type: "Controls & Inputs"}
3: {id: 4, title: "Checkbox", type: "Selection Controls"}
4: {id: 5, title: "Toast", type: "Notifications & Alerts"}
Second array
0: {id: 1, title: "Colors", type: "Design"}
1: {id: 2, title: "Typography", type: "Design"}
expected output:
0: {id: 1, title: "Button", type: "Controls & Inputs"}
1: {id: 2, title: "Switch", type: "Selection Controls"}
2: {id: 3, title: "Tags", type: "Controls & Inputs"}
3: {id: 4, title: "Checkbox", type: "Selection Controls"}
4: {id: 5, title: "Toast", type: "Notifications & Alerts"}
5: {id: 1, title: "Colors", type: "Design"}
6: {id: 2, title: "Typography", type: "Design"}