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

Hope Davis
Hope Davis
608 Points

I never see any of my prompts or alerts when I call them. I'm not sure why. Please help

var input = prompt("type in your first name") ; var input2 = prompt("type in your last name") ; var firstandLast= input.toUpperCase() + ' ' + input2.toUpperCase() ; var nameLength = firstandLast.length; alert("The string \"" + firstandLast + "\" is " + nameLength + " long.");

Trevor Bartlett
Trevor Bartlett
14,598 Points

I don't know if you just had an error when copying your code, but it appears that you forgot to add a space in your firstandLast variable. it should be firstandLast = input.toUpperCase(), but you have firstandLast= instead.

2 Answers

Trevor Bartlett
Trevor Bartlett
14,598 Points

I don't know if you just had an error when copying your code, but it appears that you forgot to add a space in your firstandLast variable. it should be firstandLast = input.toUpperCase(), but you have firstandLast= instead.

you also need forgot a capital letter in firstandLast common practise would suggest you do firstAndLast you also forgot to at a +, next to, "\" + is +.

var nameLength = firstandLast.length; alert("The string \"" + firstandLast + "\" is " + nameLength + " long.");