I am looking for a solution for the following problem. I am working with an object that looks:
0: {userId: 139, moveId: 169, moveName: "FirstRoadMove", building: {…}}
1: {userId: 139, moveId: 171, moveName: "FirstRoadMove", building: {…}}
2: {userId: 139, moveId: 173, moveName: "FirstRoadMove", building: {…}}
3: {userId: 139, moveId: 175, moveName: "FirstRoadMove", building: {…}}
4: {userId: 139, moveId: 177, moveName: "FirstRoadMove", building: {…}}
5: {userId: 139, moveId: 179, moveName: "FirstRoadMove", building: {…}}
And I also have a component:
<button className={`actionBoxButton ${props.moves[0].moveName !== "FirstSettlementMove" ? "actionBoxButtonGrey" : ''}`}
What I am trying to achieve is to not only check for the button if the first elements of moves has a key with value FirstSettlementMove e.g. but every element of the object. So in semi pseudo something like:
<button className={`actionBoxButton ${props.moves[first to last].moveName !== "FirstSettlementMove" ? "actionBoxButtonGrey" : ''}`}
Thank you in advance!
moveNameis something other than "FirstSettelmentMove"