It looks like you didn't set slaying to true


#1



https://www.codecademy.com/courses/javascript-beginner-en-mrTNH-6VIZ9/0/2?curriculum_id=506324b3a7dffd00020bf661


Tried various combinations of the code and keep receiving this error:
"It looks like you didn't set slaying to true"


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

while (slaying) {
      if (youHit) {
    console.log("A Hit" + damageThisRound + " damage!");
    totalDamage += damageThisRound;
      }
    if (totalDamage >= 4) {
      console.log("Dragon Bit the Dust!");
      slaying = false;
    } else {
    console.log("Missed. U Died");
    slaying = false;
  };
};


#2

Remove everything past the totalDamage variable. You don't need that part yet. When it runs the function it changes the variable to false.


#3

Thank You
Removed everything and lesson works!