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 trialNancy Chen
1,483 PointsCan someone please check my code? It's not showing up in the browser.
Hello, I'm trying to preview this but nothing shows up. What did I do wrong?
let question = prompt("How are you doing today?");
let question2 = prompt("What are you going to do today?");
let comboquestions = question.toUpperCase() + ' ' + question2.toUpperCase();
let numberlength = comboquestions.length;
alert(The string ${comboquestions} is ${numberlength} number of characters long.
)
1 Answer
Peter Vann
36,427 PointsOne error is that your template literals (template strings) need surrounding backticks (in the alert). (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) Example: This:
alert(The string ${comboquestions} is ${numberlength} number of characters long.)
should be typed like this:
alert(`The string ${comboquestions} is ${numberlength} number of characters long.`)
Peter Vann
36,427 PointsPlease lemmeeno if that was the issue... :)
Nancy Chen
1,483 PointsOh no, I had backticks for when I pasted it here, it ended up turning the code into a different font haha. I had them so it turned out well! Thank you!
Zaid Khan
12,769 PointsZaid Khan
12,769 PointsIs your JS file linked in HTML?