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)
![Anthony Linares](https://secure.gravatar.com/avatar/5df80dee449e29ba7c58cdfdffa80350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Linares
3,060 PointsMy code is not working for the multi line example on the video
This is what I got. Keep in mind after the \ there is a new line.
const multiline = "Hello, students. \
Welcome to javaScript Basics. \
I hope you learn a lot!";
console.log(multiline);
7 Answers
![Anthony Linares](https://secure.gravatar.com/avatar/5df80dee449e29ba7c58cdfdffa80350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Linares
3,060 Pointsyea. Is not working I don't understand what I am doing wrong. I rewrote the code and it said uncaught syntaxerror: Invalid or unexpected token. Is there a way I can upload a screenshot to the post?
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,853 PointsWhen posting code, use Markdown formatting to preserve the code's appearance and retain special symbols.
If I understand correctly what you meant to show, here's your example using markdown:
const multiline = "Hello, students. \
Welcome to javaScript Basics. \
I hope you learn a lot!";
console.log(multiline);
That should work, but be aware that the output will appear on a single line (as shown in the video). The escapes allow you to continue the string on the next line, but they don't encode a newline in the string.
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,853 PointsOn seeing the snapshot, it is clear that the cause of the "Invalid or unexpected token" error is that on line 14 (the one that says Welcome to javaScript Basics. \
), there are two spaces after the backslash. For the backslash to work as a line continuation escape, there must not by any characters between it and the newline.
Remove those spaces and the error will go away.
![Anthony Linares](https://secure.gravatar.com/avatar/5df80dee449e29ba7c58cdfdffa80350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Linares
3,060 PointsThank you very much for the help Steven. I am just going to move on, hopefully once I get more experience with JS I hope to make less errors.
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,853 PointsOK, but if you share that workspace snapshot we can identify the exact cause of the problem.
![Anthony Linares](https://secure.gravatar.com/avatar/5df80dee449e29ba7c58cdfdffa80350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Linares
3,060 PointsHello Mr. Steve, here is the link https://w.trhou.se/vnu25iikgr. the file name is strings.js under js folder. Thank you.
![Anthony Linares](https://secure.gravatar.com/avatar/5df80dee449e29ba7c58cdfdffa80350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Linares
3,060 Pointswow. Thank you very much Mr. Steve the code works now. I spend a decent amount of time on this problem and could not figure it out. Now I have a much better understand about the js syntax. Thanks again.
![Anna Oleszczuk](https://secure.gravatar.com/avatar/bb36081fa5d4a51e034dfa221bf8e9d0?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anna Oleszczuk
6,010 Pointsthis worked for me:
const multiline = "hello, students. \n\ Welcome to JavaScript Basics. \ I hope you learn a lot!";
![melanieelanduenas](https://secure.gravatar.com/avatar/6585e0c3af49f28a66744e10f8d146e1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
melanieelanduenas
Full Stack JavaScript Techdegree Student 528 Pointsthe video shows the multiline section works with the const html section on top but it doesnt. after trying out the H1 text, cut that section out and the multiline section will appear on console.
Steven Parker
230,853 PointsSteven Parker
230,853 PointsYou can cut and paste but be sure to use Markdown formatting (like I did above) to preserve the code's integrity. And you can also share an entire project if you use the snapshot function in the workspace and provide the link to that.
Anthony Linares — Glad to help. But normally, "best answer" would be selected on the one that contained the info that helped resolve your issue!![:see_no_evil: :see_no_evil:](https://image-proxy-cdn.teamtreehouse.com/7e2cd972ef43a6ce7020c3a945ab8eae1b163900/68747470733a2f2f7374617469632e7465616d74726565686f7573652e636f6d2f696d616765732f656d6f6a692f756e69636f64652f31663634382e706e67)
(you can change that now)