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
Feedback on my take on the practice
var firstName = prompt ("What is your first name?");
var lastName = prompt (" What is your second name?");
var fullName = firstName.toUpperCase()+ ' ' + lastName.toUpperCase();
var numOutput = alert("Your name " + fullName + " is " + fullName.length + " characters long.");
Jamie ReardonTreehouse Project Reviewer
Looks great and does what is intended! Only thing I could think of that maybe you could add to further improve the purpose and description of the variables is the last one
numOutput has one purpose on this script like the others. The other three variables have clear meanings for this script, I would personally rename the variable to something like
stringLength. It just gives it that more clarity when reading and understanding the purpose the variable since
numOutput could also consider to be calculating numbers for example.
Thank you! =D yes I was struggling with a name for that one.
Question: Won't this solution calculate the number of characters including the space?