numberHands
will be equal to 1,2, or 3
. It will never make it this far in the program if not. So I see no reason for else statements.
But, is this the correct syntax for writing nested if statements in JavaScript? I feel like the closing brackets are incorrect, but I'm new to js. How would you write this?
function recap() {
if (numberHands > 0) {
wonOrLost(h1.cards, h1);
}
if (numberHands > 1) {
wonOrLost(h2.cards, h2);
}
if (numberHands > 2) {
wonOrLost(h3.cards, h3);
}
playAgainOption();
}