I have the following code:
<button className={`actionBoxButton ${props.moves[0].moveName !== "FirstPassMove" && props.moves[0].moveName !== "PassMove" ? "actionBoxButtonGrey" : ''}`}
props.moves looks like this:
{userId: 30, moveId: 60, moveName: "FirstSettlementMove", building: {…}}
1: {userId: 30, moveId: 62, moveName: "FirstSettlementMove", building: {…}}
2: {userId: 30, moveId: 64, moveName: "FirstSettlementMove", building: {…}}
3: {userId: 30, moveId: 66, moveName: "FirstSettlementMove", building: {…}}
4: {userId: 30, moveId: 68, moveName: "FirstSettlementMove", building: {…}}
5: {userId: 30, moveId: 70, moveName: "FirstSettlementMove", building: {…}}
6: {userId: 30, moveId: 72, moveName: "FirstSettlementMove", building: {…}}
7: {userId: 30, moveId: 74, moveName: "FirstSettlementMove", building: {…}}
This checks if in the props.move (which is an object not an array) element 0 has a key moveName !== FirstPassMove or PassMove. But I do not want to check for element 0 only but all elements of the object. Some said I should use Array.some but since it is not an array that did not work.
Greetings
props.movelooks like beforehand.