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

Lanie Williamson
PLUS
Lanie Williamson
Courses Plus Student 11,390 Points

My Story Maker Challenge. Any improvements?

Here is my Story Maker Challenge. Any suggestions/improvements welcome. Thanks!

var person = prompt("Welcome to The Story Maker.  Please answer each question. First, name a person you know:");
var verb = prompt("Now enter a verb.");
var partOfBody = prompt("Finally enter a part of the body.");
var story = "Jack and " + person + " went up the hill ";
alert("Thanks for playing!  Now read your story.");
story += "to " + verb + " a pail of water.  ";
story += "Jack fell down and broke his " + partOfBody + " and " + person; 
story += " came tumbling after.";
document.write(story);

1 Answer

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Lanie;

Nice project. It has been a while since I went through JS Basics, but perhaps adding some language "censoring" might be a nice touch. Something to prevent "Jill" from playing perhaps as we all know what happens when she goes up the hill.

Great work!

Ken