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 trialGary Calhoun
10,317 PointsDid I miss anything from this challenge?
First off I wanted to say I am really enjoying the way Dave teaches I am completely new to javascript and this is a fun way to learn. I wanted to make sure I didn't miss any steps so here is what I came up with for my program.
var userName = prompt("What is your name?");
var message = "Hello";
document.write("Hello " + userName + "! ");
var yourAge = prompt("How old are you?");
document.write(" Wow you are " + yourAge + " years old," + userName + " you are getting old");
alert(userName + " you have finished this program");
5 Answers
rydavim
18,814 PointsYou seem to have fulfilled all the challenge requirements, and your code runs error free for me. Good job!
(Apart from making me feel old when I ran your program. ;) )
Gary Calhoun
10,317 PointsI styled it up a little bit http://codepen.io/nufftalon/pen/rVKWPO
Jacob Mishkin
23,118 PointsIt looks great! the only suggestion I would say is after the string years old in the document.write method is to have a space after the comma and before the quote. Other than that great job!
Gary Calhoun
10,317 PointsThanks Jacob will make that correction. I also noticed I could of added some html in there which I had overlooked to make it look a bit more presentable.
Sorry about that rydavim I made myself feel old myself when I tested it haha. Thanks for testing it for me!
I just updated the code actually.
var userName = prompt("What is your name?");
var message = "Hello";
document.write("<h1>Hello " + userName + "! </h1>");
var yourAge = prompt("How old are you?");
document.write(" <h1>Wow you are " + yourAge + " years old?, " + userName + " you are getting old!</h1>");
alert(userName + " you have finished this program.");
Jacob Mishkin
23,118 PointsThat's awesome! If you want to take this one step further, you can style the h1 tag by using CSS and add, styles to the program.
Gary Calhoun
10,317 PointsThanks, yeah that is a good idea maybe add css for h1 and h2 tags to give some separation and give them similar shaded colors based on importance.