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 trialjohn knight
Courses Plus Student 9,155 PointsNeed help over here!
is there anything wrong in this?
var visitor = prompt ('What is you name?');
var Age = prompt('how old are mister');
var messeage ="hello to tree house " + visitor +are you Age;
document.write(messeage);
Chris Bryan
3,654 PointsTry this
var visitor = prompt ('What is your name?'); var age = prompt ('How old are you mister?'); var message = "Hello to treehouse " + visitor + " you are " + age + "."; document.write(message);
2 Answers
Steven Parker
231,271 PointsIt looks like you're missing some punctuation.
You forgot to put quotes around the string " are you ", and you need a plus sign (+) between that and the variable Age.
You also misspelled "messeage" (with an extra "e"), but since you did it consistently it should not be a problem.
john knight
Courses Plus Student 9,155 Pointsthank you Steven!
Joseph Frazer
5,404 PointsYou forgot the quotes :)
john knight
Courses Plus Student 9,155 PointsThank you joseph Frazer!
bhuwan shrestha
Courses Plus Student 8,489 Pointsbhuwan shrestha
Courses Plus Student 8,489 PointsHi John, On line 3 you are concatenating string with variable. since {are you} is a string you have to put this inside "" and separate from variable Age using + sign. So you can correct your code like following: var messeage ="hello to tree house " + visitor +"are you"+ Age;