Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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?