Dragon slayer syntax error


#1

What do I have wrong? I've run it through a reader and all it says is "syntax error". That does not help me trouble shoot.

Here is my code:
var slaying = true;
var youHit = Math.floor(Math.random() * 2);
var damageThisRound = Math.floor(Math.random() * 5 + 1);
var totalDamage = 0;

while (slaying) {
    if(youHit){
    console.log("You hit him! " +"You did " + damageThisRound + "damage!");
    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

You are missing a closing bracket. A tip for future, open and close from the start, so later on you will not forget about them.

        } else {
            youHit = Math.floor(Math.random() * 2);
        } 
    **}** else {
        console.log("You lose!");
        slaying = false;
        }
    }