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

Tell us what’s happening:

I don’t know what I’m doing wrong!!

Step 153
Now create the isMonsterHit function. This will return a boolean value (true or false) to be used in your if statement. Return the result of the comparison Math.random() > .2.

function isMonsterHit(){
if(Math.random() > .2){
return true
}
return false
}

// Your isMonsterHit function should return the result of the comparison Math.random() > .2 .

do not use the if/else, just return the comparison

1 Like