First "if" statement


#1

8.4 (Dragon Slayer)


Where did I go astray? "SyntaxError: Unexpected token else"

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 land a great blow!");
    } else {
        console.log("The dragon burns you!");
    }
    slaying = false;
}


#2

the semi colon after Hit) is stray, please remove as it's causing the error


#3

Oh my goodness- how did I not see that? haha thanks!


#4

You're welcome,

Happy learning & coding :green_book:


#5