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 trialPeter Kelly
2,485 PointsWhat is wrong with my story? Syntax? VerbAdjNoun order?
"<h2>There [verb] an[adjective] man from [noun].</h2>"
var verb = prompt("please enter a verb"); var sentence = "<h2>There " + verb; var adjective = prompt("please enter an adjective"); var noun = prompt("please enter a noun"); alert("Are you ready to read your story?"); sentence += " a " + adjective; sentence += " man from " + noun + ".</h2>"; document.write(sentence);
1 Answer
Jamin Pratt
Full Stack JavaScript Techdegree Student 1,920 PointsAs far as grammar goes you have it asking for a noun instead of a location. so the order ( Went, Tree, green,)
will output
There went a green man from tree.
try this ''' JavaScript var verb = prompt("please enter a verb"); var sentence = "<h2>There " + verb; var adjective = prompt("please enter an adjective"); var noun = prompt("please enter a noun"); alert("Are you ready to read your story?"); sentence += " a " + adjective;
sentence +=/Here/ noun + "from Sicily" + ".</h2>"; document.write(sentence); '''