
Nancy 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
26,484 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
26,484 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,501 PointsZaid Khan
12,501 PointsIs your JS file linked in HTML?