I have an array of buttons with a 'selected' and 'deselected' state. How do I go about checking if any button in the array is in the 'selected' state.
So essentially I want something like (using Framer coffeescript):
for button in buttonArray
button.onClick ->
this.stateCycle("selected", "default")
if any button in buttonArray state.current == "selected"
activateMainButton()
else
deactivateMainButton()
Here is my prototype: http://share.framerjs.com/11abcrlne5op/ (go to the ethnicity section).