4/6 help please, illegal token


#1

var slaying=true;
var youHit=Math.floor(Math.random()*2);
var damageThisRound=Math.floor(Math.random()*5+1);
var totalDamage=0;
while(slaying) {
if(youHit) {
console.log("Nice hit!");
} else{
console.log("Damn..the dragon just ripped your heart out !);
}
slaying=false;
}

Can someone please help me ..?


#2

ahah.. ok well after multiple rechecks I found out the problem.. I had forgotten a " at the end of the else console.log.. fml

here is the correct version.

var slaying=true;
var youHit=Math.floor(Math.random()*2);
var damageThisRound=Math.floor(Math.random()*5+1);
var totalDamage=0;
while(slaying) {
if(youHit) {
console.log("Nice hit!");
} else{
console.log("Damn..the dragon just ripped your heart out !");
}
slaying=false;
}