|
|
|
|
|
by JuanPosadas
999 days ago
|
|
I'm probably on the mild side of abusing it, I've never seen another developer on my team use it, but I also include self-describing variables for the values. If the reducer function itself is non-trivial, I've give it a name so the final product may look like: const idNameMap = itemList.reduce(toIdNameMap)
It should be intuitive that itemList is a list of objects familiar to the context of the code, and the result will be like: [{"id1":"Billy"}, etc.
|
|