⛄ Snowberb ⛄ – 13-58 Jun 16
Having this array:
How can I transform that array into a new one with the following structure using
.reduce
?:
6 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That doesnt look very clean
Is that the best way?
I was trying to use
reduce
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
reduce returns a new array doesnt it?
how would you do it with reduce?
it has been a very long time without using reduce so I really do not know how to do it
I got a version working with reduce, but to be honest I don't see anything wrong with the for loop version, it ended up quite similar
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/986993215112642600