Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Set the 'escapedNewLine' variable to the string of a new line character.

hi im on this code challenge and I dont understand the question I use this code but its not correct apparentlyvar escapedNewLine = "escaped\nNew\nLine"; thanks for the help!

5 Answers

Answer is "\n"

Misleading question challenge, I know.

WOW! Thanks! definitely not what i expected.

Never mind I just needed to use \n as the string

whats the right answer! I don't get the question at all??

var escapedNewLine = "\n"; console.log(escapedNewLine);

Agreed, this question is confusing. I was trying to write a string with a new line. When would you ever set a string to just \n in javascript?

Merche Haruna Hirooka
Merche Haruna Hirooka
11,526 Points

var escapedNewLine ="\n";

went correct