[solved with a reboot] Basic Javascript unable to enter two slashes

Tell us what’s happening:
I’m literally on the first step of the basic javascript course, it wants me to type

//This is an inline comment

but as soon as I put in one slash, it won’t let me type the second, and the display in the bottom right shows:

SyntaxError: unknown: Unterminated regular expression. (1:1)

1 | /
| ^

Same problem in both MS Edge and Chrome.
I’m sure I’m just missing something really obvious…

Your code so far

Your browser information:

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

Challenge: Comment Your JavaScript Code

Link to the challenge:

for a clearer understanding, it allows me to type anything else after the first slash, but not a second slash. I tried copy/pasting a double slash into the text box, and then it wouldn’t let me type anything else

Yes, if you type just one forward slash on a line then you will get a syntax error. I’m not sure why you wouldn’t be able to type two forward slashes on a line? Can you type the other type of comment?

I think you are not putting “//” but “|/” which is incorrect. That’s why it i showing an error. I tried the challenge and it let me put “//” both the slashes.

Well, no idea what the issue was, but I followed the great classic wisdom of Roy Trenneman, and everything works now!

Have you tried turning it off and on again?

That is always good advice to follow. Also, make sure you eat your minimum requirements of fruits and veg.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.