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

Ahmed El-Kordy
Ahmed El-Kordy
3,560 Points

feedback on my solution please, i Dave solution but i need to know your opinion on mine.

var firstName = prompt('What is your First Name?'); var visitor = firstName; var lastName = prompt('What is your Last Name'); visitor += ' ' + lastName; alert(visitor.toUpperCase() + ' is ' + visitor.length + ' Character long.' );

1 Answer

Hi, your code is pretty good, the only thing you could have done (with the topics you might know) is that:

var firstName = prompt('What is your First Name?'); 
var lastName = prompt('What is your Last Name'); 
var vistor = `${firstName} ${lastName}`;
alert(`${visitor} is ${visitor.length} characters long!`);

Don't forget to mark as best answer if it helped you! Happy Coding!