4/6 First If. Not sure why it is asking for this


#1

var slaying = false
var youHit = Math.floor(Math.random() * 2)
var damageThisRound = (2)
var totalDamage = (0)
while(slaying) {
if(youHit === 1) {
console.log("You hit.You Win");
} else {
console.log("You miss.");
}
slaying = false;
};

keeps asking for me to log a message to console to let the player know if they won or lost where. Not sure what to do?


#2

@brian_marmon take a look at this

//this is whats causing the problem
//value of slaying must be true here
var slaying =true
var youHit = Math.floor(Math.random() * 2)
var damageThisRound = (2)
var totalDamage = (0)
while(slaying) {
    if(youHit === 1) {
        console.log("You hit.You Win");
    } 
    else {
        console.log("You miss.");
    }
    slaying = false;
};