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

Mark Chang
Mark Chang
5,214 Points

My alert didn't pop up!

Idk what wrong of my code but the alert didn't pop up when I preview the workspace!

Code (click practice.js for the code) : https://w.trhou.se/2xtfsnvm4w

Frans de Haan
Frans de Haan
6,315 Points

Can you share your code

Mark Chang
Mark Chang
5,214 Points

Sorry for that i just forgoted

1 Answer

Frans de Haan
Frans de Haan
6,315 Points

Hello Mark Chang,

It need to be like this:

var firstname = prompt("What is ur first name?");

var lastname = prompt("What is ur last name?");

var completename = firstname.toUpperCase() + ' ' + lastname.toUpperCase();

var charaterCount = completename.length;

alert("The string \"" + completename + "\" is " + charaterCount + "characters long.");

In the alert you used a uppercased n in completename variable. And I switched the 3 and 4 rule because you can't tell the length if it's not defined jet.

Mark Chang
Mark Chang
5,214 Points

Thx for answering my question :)