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 trial

JavaScript The Solution

Can 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.)

Is your JS file linked in HTML?

1 Answer

One 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.`)

Please lemmeeno if that was the issue... :)

Oh 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!