Answer the question
In order to leave comments, you need to log in
Compare two arrays and output the updated array?
Hello guys..
There are two arrays with objects.
arr[0:{id: 1, name: bu, title: Hello, message: error}, 1:{id: 2, name: mu, title: Hello, message: error}]
tempDates[0:{id: 2, name: bu, title: world, message: success}]
result[0:{id: 1, name: bu, title: Hello, message: error}, 1:{id: 2, name: bu, title: world, message: success}]
Answer the question
In order to leave comments, you need to log in
Found a solution and it works. Thanks for the many answers)
If suddenly anyone needs:
for (let i = 0; i < data.data.addEngineer.length; i++) {
let item = this.order.filter(x => x.id_order === data.data.addEngineer[i].id_order);
item.forEach((found) => {
found.first_last_name = data.data.addEngineer[i].first_last_name;
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question