Welcome to the Treehouse Community
Looking to learn something new?
Why isn't my string working? var escapedNewLine = "this is line 1\nThis is line 2"; var escapedBackslash = ""; var escapedTab = "";
Fernando Ramos4,369 Points
Poorly structured questions.... for those of you having issues on this challenge, this is what they want (it should not have been this hard if they worded it right or stated "Do not give an actual string sentence, just the properties for 'new line, escaped key, and tab key' within each blank quotes." Geez:
Challenge task 1 of 3 Set the 'escapedNewLine' variable to the string of a new line character. var escapedNewLine = "\n"; ..................
Challenge task 2 of 3 Set the 'escapedBackslash' variable to the string of a backslash character. var escapedBackslash = "\"; .....................
Challenge task 3 of 3 Set the 'escapedTab' variable to the string of a tab character. var escapedTab = "\t";
The challenge wants the string to be only the escaped newline. You can't add in extra characters
Erik McClintock45,783 Points
As Jason says, the issue here is in the way that this particular code challenge task is phrased, not in how you're writing your new line escape character itself.
It is looking for you to literally and simply set the var escapedNewLine equal to what the escape new line character is, not to create a string that uses the escape.
Hope this helps to clarify!
if you follow the 2nd answer of Fernando Ramo's, the first answer will no longer be correct so here is what you do:
1) "/n" 2)"//" 3)"/t"