Challenge Escape Sequences in Strings has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var myStr = "FirstLine\n\\SeondLine\\\rThirdLine";
When running this in my web dev console i receive
"FirstLine
\SecondLine\ThirdLine"
However when I run this code with \n
rather than \r
var myStr = "FirstLine\n\\SeondLine\\\nThirdLine";
"FirstLine
\SecondLine\
ThirdLine"
which I believe is what we're after - That being said neither runs in the platform
SeondLine
check that its not a typo that is causing it to fail?
Please clarify more as requested.
The platform is refusing to accept my answer too. I tried
var myStr='FirstLinen\SecondLine\nThirdLine';
and the output being shown is
myStr="FirstLinen\SecondLine\nThirdLine"
instead of the expected output. I asked for help in the chat room and people told me that my code gives the expected result when they run it.
Most helpful comment
SeondLine
check that its not a typo that is causing it to fail?