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

Could you check my code to verify all looks good?

The code below seems correct to me but on a Mac OS X 10.10.5 in Chrome 51.0.2704.79 the prompts are no longer popping up.

var noun = prompt("Please type in a noun");
var sentence = "<h3>Once upon a time a " + noun;
var verb = prompt("Please type in a verb");
var adjective = prompt("Please type in an adjective");
alert("You're done! Story time.");
sentence += " was running around in the forest looking for fun.";
sentence += " The" noun + " decided to " + verb + " all the way to the end of the forest to find comfort.";
sentence += " The" noun + " found the end of the forest, only to be greeted by friends and family.</h3>";
document.write(sentence);

Ok so as far as the way you are doing every thing its just fine. Only thing you for got to put a couple of + signs in your concatenation. Here is the updated code every thing should work now. Let me know if you have any questions.

var noun = prompt("Please type in a noun"); 
var sentence = "<h3>Once upon a time a " + noun; var verb = prompt("Please type in a verb"); 
var adjective = prompt("Please type in an adjective"); alert("You're done! Story time."); 
sentence += " was running around in the forest looking for fun."; 
sentence += " The" + noun + " decided to " + verb + " all the way to the end of the forest to find comfort.";
sentence += " The" + noun + " found the end of the forest, only to be greeted by friends and family.</h3>"; 
document.write(sentence);

3 Answers

Thank you Alex for the assist. Next time I need to debug a bit more deeper in the syntax.

Rick, thank you for the tip. JSHint.com helped me out tremediously. I'll be adding this website to my toolkit.

Have a good day all!

Cheers!

Yep not a problem glad i was able to help out.

Just my two cents, Andrew: I've found JSHint.com to be an invaluable resource for times when my JS is not working like it should. Hope that helps in the future.

Yes defiantly allwase run your code threw JShint helps out so much

You're quite welcome!