Learn Basic JavaScript by Building a Role Playing Game - Step 153

function isMonsterHit() {
return Math.random() > .2;
health < 20 || health > 0
}

what is wrong with this code? :female_detective:

Please post a link to the step and talk to us about how you are stuck in your own words. Thanks

Hi @isil.ozdemir

At the end of your return statement, use the logical OR operator || and check if health is less than 20 .

You placed code below the return keyword.
Any code after a return statement is ignored, which is why the code appears faded.

image

Happy coding

1 Like

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

Welcome to the Forum @Elikem!

As @Teller has replied, the forum is for helping with specific issues. We will be glad to help if you have an issue or problem. :smiley: