Lesson 2 Dragon slayer PL help Save & submit code not working


Here is my code

    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("You hit!");
        if (totalDamage>=4) {
            console.log("Dragon has croaked, congrats you just killed more wildlife, your ansestors must be pround with you for making another species extinct!");
    } else {
        console.log("You missed!");


You will want to get out of the WHILE loop
if totalDamage>=4
by setting the variable slaying to false