This forum is now read-only. Please use our new forums at discuss.codecademy.com.

1007 points
E0f4de4518b9e97ab05102eb67df437f?s=140&d=retro
Submitted by
Caleb C
almost 4 years ago

Can someone please check out whats wrong with my code??

while(slaying)
{
if(youHit === true)
{
console.log("You hit the dragon!!!");
console.log("You won!");
}
else
{
console.log("The dragon killed you");
console.log("You lost!");
}
slaying = false;
}


0 votes

permalink

Hey! So I didn't test it I'm kinda in a hurry but I'm pretty sure that your problem is that in line 3 it should say if(youHit===1) or even if(youHit).
That is because youHit gives either 1 or 0

261 points
Picture
Submitted by
Garrett Hollar
almost 4 years ago