Skip to content
Advertisement

Diferent ways to rearrange data from one array into another

From API, I get array of attendances by date with members data. My task is to convert that data to array of objects with clients data end attend_date. I managed to accomplish that in following snippet. My plea to You is for hint for other, perhaps more performant or more elegant way for solving my task.

JavaScript

Advertisement

Answer

You can also do this with some nested maps and a little destructuring

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement