What's wrong? The first If statement


#1

What's wrong?

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("You hit");
}
else {
console.log("You lost");
}
slaying = false;
}

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


#2

Nevermind, i got it , i set the first var slaying = true instead of var slaying = false