Plese help, what is my problem here?


#1

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

while(slaying)
{
if (youHit)
{
console.log("Congratulations!!! You hit!");
}
else
{
console.log("The dragon defeated yo");
}

slaying = false;

}


Replace this line with your code.


#2

the while loop will never run, you define slaying here:

var slaying = false;

but you set it to false rather then true, meaning the loop condition will never be true, loop won't execute, you get an error message.


#3

aaa Okay! Thank you! )))


#4