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 trialMark Chang
5,214 PointsMy 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
Mark Chang
5,214 PointsSorry for that i just forgoted
1 Answer
Frans de Haan
6,315 PointsHello 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
5,214 PointsThx for answering my question :)
Frans de Haan
6,315 PointsFrans de Haan
6,315 PointsCan you share your code