Answer the question
In order to leave comments, you need to log in
How to fix typescript error?
Good afternoon.
There is an array Product[]. Also there is an object containing Record
The array at me ordered. The task is to collect an array from an object with the same sequence as the presented array. The task itself is not difficult, I solved it like this:
const result = dataProduct.products.map((item) => ({
...item,
...data[item.id]
}));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question