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)
![ja5on](https://uploads.teamtreehouse.com/production/profile-photos/11535073/micro_Sprockets.jpg)
ja5on
10,338 PointsPart of the video is learning how to show quotes in a string ""
I know template literals aren't shown at this point but to encourage people that later on there is a quicker way, you could also research template literals.
My code:-
const message = "I'm a programmer!" ; surround "I'm a programmer!" with backticks ``
console.log(message);
The above shows "I'm a programmer!" in the console.
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,867 PointsYou can also get the same result just as quickly by surrounding it with apostrophes ''
("single quotes").
Best practice would be to only use backticks to create a template literal when you will also be using one or more substitution tokens (something like ${name}
) in the literal.
![Tony Idehen](https://secure.gravatar.com/avatar/9cba1d3d5f88196b7b0d5c7738886c31?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Tony Idehen
8,059 PointsBetter to use either single or double quotes but put a backslash after I ie " I\'m a programmer!"; or ' I\'m a programmer!';
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,867 PointsThe backslash escapes the character behind it (in this case the apostrophe). But you don't need them in this example since the surrounding quotes use a different character.
ja5on
10,338 Pointsja5on
10,338 PointsNever used single quotes, Guil says to choose either single or double and stick with it, so I stuck with double. However your right you do interpolate into the template literals. 👍
Steven Parker
230,867 PointsSteven Parker
230,867 PointsI also generally use double quotes. But in this case the string contains double quotes, so this would be a good place to use single ones to enclose the string.
You can still enclose the whole thing in double quotes, but you'd need to escape each of the quotes that is part of the content by preceding it with a backslash ("\").