Hi all. I’m new to programming but enjoying the algorithm challenges so far in javascript. I’m not sure but I think I encountered a bug since my solution works on both Repl.it and Brackets but doesn’t seem to work here. So please let me know what I am doing wrong if this is not a bug. Thank you!
To me, this means for all instances of &in a string, replace it with &. Is that what you intended? For finding ampersands in a string, the /&/g regular expression works.
Hopefully that’s enough of a hint for you to solve this.
Oops. Something went wrong with the copy paste. This isn’t what I had. I’m not sure how the amp got there for each one. Wtf. But yea, my problem should be without the amps. Let me see if I can fix this on mobile. Sorry for this. But my first point should still stand that my solution couldn’t work.
@CaraLagumen it appears to be something with the copy/paste that’s messing things up. When I copy/paste your code into the challenge editor, all the tests fail. When I delete and re-type your HTML codes (i.e. '<') in the editor to match what you have, the tests pass. I don’t think this is a bug with the challenge, but is something strange happening with the copy/paste instead.
Oh I see… Thank you so much. I like to use replit since I console log to see my work then copy paste them. That explains a lot. I will type everything from now on. Thank you!!!
Wanted to weigh in and say I had the same issue. Instead of typing out the HTML, I just copied it from the pass conditions, which wouldn’t pass, but typing it out manually (or copying the exact same solution from the hint page) worked fine. Not sure why this happens, but it definitely caused me to waste a lot of time.
If you copy and paste from the description you can find invisible characters in your code. You don’t see them but the code does so the tests don’t pass