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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![André Sousa](https://uploads.teamtreehouse.com/production/profile-photos/11540761/micro_IMG_20170327_164245.jpg)
André Sousa
Full Stack JavaScript Techdegree Student 735 PointsUncaught SyntaxError
This is my code:
const multiline = "Hello, world. \ This is me. \ Your master.";
(keep in mind this in separate lines)
It is giving me an error, it doesn't let me put a string in different lines.
5 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,867 PointsA multi-line string can be created as a template literal. Use accents ("backticks") instead of quotes or apostrophes to enclose the string body:
const multiline = `Here is a string
with two lines`;
A normal string can be extended to multiple source lines by putting a backslash at the end of the continued line:
const singleline = "Here is a string \
shown on just one line";
Make sure there are no characters (including spaces) after the backslash!
If you still have trouble, make a snapshot of your workspace and post the link to it here so the issue can be replicated.
![André Sousa](https://uploads.teamtreehouse.com/production/profile-photos/11540761/micro_IMG_20170327_164245.jpg)
André Sousa
Full Stack JavaScript Techdegree Student 735 PointsThank you, I hadn't arrive to that part yet. But I am doing exactly as in the video and still get the error, and that is not supposed to happen.
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,867 PointsI expanded my answer.
![André Sousa](https://uploads.teamtreehouse.com/production/profile-photos/11540761/micro_IMG_20170327_164245.jpg)
André Sousa
Full Stack JavaScript Techdegree Student 735 PointsThank you very much Steven, that was it!
![Jason Robbins](https://secure.gravatar.com/avatar/03e2bb5723e1d2f208328b1f00a81c3b?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Jason Robbins
7,117 PointsAnother possible solution:
const multiline = "Here is a string \n with two lines"; console.log(multiline);
![Muhammad Khan](https://uploads.teamtreehouse.com/production/profile-photos/11550873/micro_IMG_0399.jpg)
Muhammad Khan
Courses Plus Student 8,772 PointsHi there, I had the same Uncaught SyntaxError in multiline statement. But when I have removed blank space after \ my program is running fine and giving desired output. So, it's important to make sure there is no space or any character after \