4. The first "if" statment


#1

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

while (slying) {
if (youHit) {
console.log("You Hit The Dragon");
} else{
console.log("The dragon defeated you");
}
slying = false;

};

Oops, try again. Make sure you log a message to the console to let the player knows if (s)he won or lost!

??


#2

Solved, missing "A" in Slaying :smiley: