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

Tell us what’s happening:

Your code so far


The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ YaBrowser/ Safari/537.36

Challenge Information:

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

return hit>0?true:false;

why doesn’t the code work?

Hi! Read the instructions carefully and replace in your code exactly what it should return of true and what it should return if false. (So replace the booleans “true” and “false” in your code.

I can’t understand her any other way, this is the only way

Your code only returns the Boolean “true” when the condition is true. The instructions say:
that returns hit

when the condition is true.

You must replace the word “true” with what the instructions say.

1 Like

Change the value of “true : false”, to the instruction given.