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 trialBryan Becker
8,849 PointsWhy doesn't my code work for this challenge?
Wondering what's wrong with this code and why it wont work for the challenge?
"<h2>There once was a [adjective] programmer who wanted to use JavaScript to [verb] the [noun].</h2>"
var adjective = prompt('Please give me an adjective'); var verb = prompt("Please give me a verb"); var noun = prompt("Please give me a noun"); alert("All done. Ready for the message?"); var sentence = "<h2>There once was a" + adjective + "programmer who wanted to use JavaScript to " + verb + "the " + noun."</h2>";
document.write(sentence);
1 Answer
Aaron Kaye
10,948 PointsYour final sentence is a bit off. This is how it should be:
var sentence = "There once was a" + adjective + "programmer who wanted to use JavaScript to " + verb + "the " + noun+".";
The change is the after the noun I concatenated the period as another string.
Bryan Becker
8,849 PointsBryan Becker
8,849 PointsThank you! That seemed to take care of the problem.