Stuck on #4 Dragon slayer


#1

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

while(slaying === true){
if(youHit = 1){
var slaying = false;
console.log ("You hit the dragon" )
}
}
else {
slaying === false;
console.log("dragon defeated you")
}

it keeps saying
Oops, try again. There was a problem with your syntax.

help please


#2

the else should be inside the while loop.

inside else, you should se slaying to false (single equal sign), not comparing

the if condition you should compare youHIt with 1 (using 2 or 3 equal signs, 1 means assign)


#3

Thank you so much alot


#4