hi everyone,
Could someone help with this step?
I can see that the code looks wrong/doesn’t make much sense, but I did try to follow the instruction?
Step 139
Back to your attack
function - inside the else if
block, create another if
and else
statement. If the player is fighting the dragon (fighting
would be 2
), call the winGame
function. Move the defeatMonster()
call to the else
block.
For this step, you will need to use the strict equality (===
) operator to check if fighting
is equal to 2
. The strict equality operator will check if the values are equal and if they are the same data type.
code below:
if (fighting === 2) {winGame();
else {defeatMonster();
}
}```