I have two objects array:
let arr1 = [
{ id: "abdc4051", color: "red" },
{ id: "abdc4052", color: "blue" }
];
let arr2 = [
{ uid: "abdc4051", name: "wall" },
{ uid: "abdc4052", name: "kitchen" },
{ uid: "abdc4053", name: "sofa" },
{ uid: "abdc4054", name: "room" }
];
I need to make join by id and uid, according to example above I expect this result:
let arrNew = [
{ uid: "abdc4051", name: "wall", color: "red" },
{ uid: "abdc4052", name: "kitchen", color: "blue" }
];
I what the elegant way to do it in ES6?