Most of the solutions I’m seeing are a few years old and It isn’t solving my problems
here’s the string I’m having some issues with
Assign the following three lines of text into the single variable
myStr using escape sequences.
You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.
Note: The indentation for
SecondLine is achieved with the tab escape character, not spaces.
here’s what I typed:
var myStr = “FirstLine\n\t\SecondLine\nThirdLine” ;
any thoughts on how to get this challenge solved??
Can you post a link to the challenge?
By the way welcome to freecodecamp forum!
Thank you for your warm welcome
Do you get an error with your code? Or what does the output terminal say?
// running tests
should contain the strings
(remember case sensitivity)
should be followed by the newline character
should contain a tab character
which follows a newline character
should be preceded by the backslash character
There should be a newline character between
should only contain characters shown in the instructions // tests completed
Recheck what you are missing. You are missing just one thing in your code.
I added new line character
backslash character preceeds SecondLine (but it’s showing as that one this thread)
newline and tab character also included.
what could I be missing.hmmmm?
Check again. Hint: you are missing one symbol.
you got it. Did you pass the test?
Unfortunately, I’m still getting the error.
Try using this quote " " Instead of what you have.
"Use this quote"
“Instead of this”
it’s double quoted already
The quote that you are using showed an error in my console too but I changed it to the quote above and it worked.
Try using this one to see if you pass the test.
" " does not work as well
I am not really sure in that case. This code actually passed the test for me.
Try copying this and if it doesn’t work then let’s wait for the input of someone more experienced. I am tagging @JeremyLT
var myStr = "FirstLine\n\t\\SecondLine\nThirdLine" ;
What does it show in your console? Can you post a picture like this?
This works fine . The problem was there was a semi colon -which is meant to be at the end- between var myStr and assignment operator =
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.