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 trialB V K Mahijendra
9,133 Pointstemplate literal
Quiz Question 2 of 6 Please fill in the correct answer in each blank provided below.
Fill in the blank(s) below:
Complete the code below to create a template literal:
const headline =-- <h1>A Literal Headline</h1>--;
5 Answers
Muhammad Anwar Ul Haq
Full Stack JavaScript Techdegree Graduate 18,781 Pointsconst drink = `${flavor} ${type}: $${price}`;
James Barshaw
4,167 Pointsthis is not the right answer I have tried it in many ways and it doesn't work
Jonathan Grieve
Treehouse Moderator 91,253 PointsTo make a template literal, you use the backtick characters... like this ` `
.
let templateLiteral = `this is
a template
literal
`;
B V K Mahijendra
9,133 Pointsthank you
B V K Mahijendra
9,133 PointsConvert the set of concatenated strings assigned to the drink variable to a template literal. The final string should Need help with this one.. Convert the set of concatenated strings assigned to the drink variable to a template literal. The final string should be "Blueberry Smoothie: $4.99".
const flavor = "Blueberry"; const type = "Smoothie"; const price = 4.99;
const drink = ${flavor} ${type}:$ ${price}
; ( this ain't working, could you help me with this? )
Jonathan Grieve
Treehouse Moderator 91,253 PointsWell, you've got the interpolation syntax just right. :)
You're missing the characters to actually make the template literal string.
Look carefully at what the example is saying. With these kinds of challenges, you have to get the string output just right as the code behind the scenes is looking for something specific! :-)
Good luck!
starr13
2,494 PointsBack Ticks before and at end before;