Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Strings Escape Characters

Any help. Would you tell me what's wrong with this answer?

var escapedNewLine = "this is line1\nThis is line2\nThis is line3";
var escapedBackslash = "C:\\folder\\script.txt";
var escapedTab = "this is line1\nThis is line2\nThis is\t line3";

2 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Hi ed quijano

You've provided really good examples of those escape characters in action. The question is asking for something a lot simpler: just provide the escape characters -- with nothing else. So the first line should just be:

var escapedNewLine = "\n";

oh men! Thanks Dave

Dave McFarland
Dave McFarland
Treehouse Teacher

You bet! You're just too smart for that quiz :)