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 trialBlake Runyon
Full Stack JavaScript Techdegree Student 7,539 PointsTemplate Literals
Why is the kicking an error?
const name = prompt ( "What is your name?");
const message = `Hello: ${name}. It's ${2 * 3}PM. `;
alert ( message );
2 Answers
Clayton Perszyk
Treehouse Moderator 48,850 PointsIt looks like your message isn't in a literal, should be:
const message = `Hello: ${name}. It's ${2 * 3}`
Notice the tick marks.
Steven Parker
231,153 PointsThe font change implies tick marks were used, but Markdown formatting was not applied to display them correctly.
As a mod, you should be able to fix the formatting.
Blake Runyon
Full Stack JavaScript Techdegree Student 7,539 PointsHey Steve - If I write mine, then yours they look similar?
const message = `Hello: ${name}. It's ${2 * 3}PM. `;
const message = `Hello: ${name}. It's ${2 * 3}`
Steven Parker
231,153 PointsIt looks better now with the formatting added (either by you or Clayton). But it could be that the code is good yet doesn't meet the objective. Please provide a link to the challenge and we can check it out.
Blake Runyon
Full Stack JavaScript Techdegree Student 7,539 PointsSorry all, this is kicking an error when I put it in the console. This isn't for a challenge.
Steven Parker
231,153 PointsYou are just typing these lines into the browser JavaScript console? What error do you get?
Or do you mean the workspace console? If that's it, you can't enter JavaScript code there. You'd need to create a web project and then "preview" it.
Steven Parker
231,153 PointsSteven Parker
231,153 PointsIf this is for a challenge, please provide a link to the challenge page.