Get sum using states from different components

So I’m creating an app to vote what boardgame players want to play next. The ideas is that there is a drag and drop list column for each of the 4 players and they put the games they want to play in order.

I’ve managed to get the cards to show the “voting value” which is basically the new array length - the item’s current index.

However, what I don’t know how to tackle is how can I get the total score component at the bottom to sum up the correct “voting value” for that game from each of the players?

:balloon:Hello @Patchalv! Welcome to the forum!

You could use a dictionary/object to store the votes (values) by game name (the key) and maybe use the reduce method to extract the winning result?

Does this help?

Happy Coding! :slightly_smiling_face:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.