4
I have the following exit:
[ { rank: 1, item: { userName: 'Rafaela', score: 600 } },
{ rank: 2, item: { userName: 'Carla', score: 410 } },
{ rank: 2, item: { userName: 'Yuri', score: 410 } },
{ rank: 3, item: { userName: 'Jompas', score: 300 } },
{ rank: 4, item: { userName: 'Jonas', score: 266 } },
{ rank: 4, item: { userName: 'Tereza', score: 266 } },]
Rank draws are displayed one below the other with the same placement. I would like to know a way to take these draws and save within one object, to receive the following output:
[
{ rank: 1, item: { userName: ['Rafaela'], score: 600 }},
{ rank: 2, item: { userName: ['Carla', 'Yuri'], score: 410 }},
{ rank: 3, item: { userName: ['Jompas'], score: 300 } },
{ rank: 4, item: { userName: ['Jonas, Tereza'], score: 266 } },]
I would like to receive the data in this or similar way. I have tried several ways but the code got big and did not work very well, I believe that act some simpler way to solve.
Your question seems to have some problems and your experience here in Stack Overflow may not be the best because of this. We want you to do well here and get what you want, but for that we need you to do your part. Here are some guidelines that will help you: Stack Overflow Survival Guide in English.
– Maniero