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 JavaScript Basics (Retired) Storing and Tracking Information with Variables The Variable Challenge

Here's my story! Let me know what you think. :-)

var noun = prompt("Please type in a noun.");
var adjective = prompt("Thanks. Now, please type in an adjective.");
var verb = prompt("Great. Now, please type in a past tense verb.");
var city = prompt("So far, so good. Now, please type in the name of your favorite city.");
var timePhrase = prompt("You're doing just great. Lastly, please type in a time phrase, for example, \'seven years\'.");
var fullStory;
fullStory = "About " + timePhrase + " ago, this " + adjective + " " + noun + " " + verb + " its way through " + city + ". The End.";
alert(fullStory);
Garrett Carver
Garrett Carver
14,681 Points

Nice one! You could turn this into a full blown madlibs game!

1 Answer

This is mine :)

var adjective = prompt("Enter an adjective of your choice");

var noun = prompt("Enter a noun of your choice");

var verb = prompt("Enter a verb of your choice");

var ready = alert("Ready to see the funny sentence ?");

var answer = "The " + adjective + " " + noun + " " + "was " + " " + verb + "."

document.write(answer);