5. Syntax error


#1

Such an odd error. My code matches up seamlessly with codeacadamy's from the outset...What am I doing wrong?

while(slaying)
{

if (youHit)
{
    console.log("You Hit!"); 
    totalDamage += damageThisRound;
        if (totalDamage >= 4)
        {
            console.log("You win!");
            slaying = false;
        } 
         else 
        (
            youHit = Math.floor(Math.random() * 2);
        }
} 
else 
{
    console.log("You lose!");
    slaying = false;
}

}


#2

read THIS PLEASE. I will take a look at your question


#3

Your problem is here, you accidently put a paranthesis instead of a curly bracket:


#4

Oh my wow...so embarrassed rt now :frowning: