I noticed that you had some comments in the code for cleanup on helper functions.
I started going through them and with the combination of Object.values and Array.reduce I was able to achieve the object formatting you wanted and also remove the dependency on pulling a count value from the API Response. I know that JavaScript object property order is predictable but it still seemed gross and cleaned up the code a bit.
.. inside mapScoreboard I was also able to reduce the array iterations from 4 to 3... still some work we can likely do there though.
All tests run and pass
Executed 98 of 98 specs SUCCESS in 0.214 sec.
I noticed that you had some comments in the code for cleanup on helper functions.
I started going through them and with the combination of
Object.values
andArray.reduce
I was able to achieve the object formatting you wanted and also remove the dependency on pulling acount
value from the API Response. I know that JavaScript object property order is predictable but it still seemed gross and cleaned up the code a bit... inside
mapScoreboard
I was also able to reduce the array iterations from 4 to 3... still some work we can likely do there though.All tests run and pass
Executed 98 of 98 specs SUCCESS in 0.214 sec.