Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Getting Started With ES2015 Using Template Literals Review Template Literals

Please...Help me to fill this

Here is the question "Complete the code below to create a template literal"

2 Answers

Steven Parker
Steven Parker
215,940 Points

Take a look at the hints and generic example I provided in your other question.

In Javascript to do string interpolation you have to use backticks for opening and closing the sting. When including variables inside one of these string you have to format it like this ${variable}, so in the case of that question, it would look like this :

let message = `Hello ${name}. How are you?`

If you want to look into a bit more, this is the MDN page on template literals