function isMonsterHit() {
return Math.random() > .2;
health < 20 || health > 0
}
what is wrong with this code?
function isMonsterHit() {
return Math.random() > .2;
health < 20 || health > 0
}
what is wrong with this code?
Please post a link to the step and talk to us about how you are stuck in your own words. Thanks
At the end of your
return
statement, use the logical OR operator||
and check ifhealth
is less than20
.
You placed code below the return
keyword.
Any code after a return
statement is ignored, which is why the code appears faded.
Happy coding
Hello Teller, I am new here n new into coding can you please assist me through this new endeavor? I want me feet on the path… since I have been trying to learn it on my own n it’s really overwhelming. Thank you.
Welcome to the forum @Elikem
The forum is here to help other developers. If you have a question or an issue you like to raise, please open a new topic so the forum can assist.
Happy coding