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 trialJoseph Harlow
Front End Web Development Techdegree Student 8,243 PointsComplete the code below to create a template literal: const headline = '<h1>A Literal Headline</h1>';
Please help. Can't seem to get this one.
Joseph Harlow
Front End Web Development Techdegree Student 8,243 PointsThank you Tim! That was driving me crazy as couldn't work out why it wouldn't work!
1 Answer
Steven Parker
231,275 PointsAs Tim observed, template literals are enclosed in accents ("backticks") instead of apostrophes:
` these, not these '
But it might be worth pointing out that a template literal is not needed in this example, as no tag, interpolation tokens or newlines exist here. A plain string would do just as well here in practical code (and would be more "best practice").
Tim Oltman
7,730 PointsTim Oltman
7,730 PointsTemplate literals are created only with the "tick" or "prime" character that is located to the left of the number 1 on your keyboard (above tab). This is different than the single quote character you are using in your question above.