DEV Community

Discussion on: You don't need Array.reduce()

Collapse
lewiscowles1986 profile image
Lewis Cowles • Edited on

to anyone liking this, it works better if you just send in users. Then it doesn't matter where they come from, and anything with 0 likes just adds items to the list...

In-fact it doesn't need to be a user at all. Just something implementing a likeable interface, which has a method to retrieve likes.