Learn Basic JavaScript b Building a Role Playing Game step 152

Hi guys, my code is :

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

and this what is asking :

The player should hit if either Math.random() > .2 or if the player’s health is less than 20.

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

and this is what shows after chekingk my code:

Your function should return the result of the comparison Math.random() > .2 or `health < 20

whats i am doing wrong ?

you need to use || on this line after your existing Math.random() > .2 as the challenge says:

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

here is the correct code :slight_smile:
– removed –

This was already solved 4 months ago

Please do not post solution code.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.