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

R R
R R
1,570 Points

This (very simple) code works, but I bet there's a better (best practice) to write it. Suggestions?

var noun = prompt ("Type in a noun.");
var verb = prompt ("Type in a verb");
var adjective = prompt ("Type in an adjective");
alert("you're done!");
var story = "My " + adjective + " " + noun + " might not look like much, but it " + verb + "!."; 

console.log(noun);
console.log(verb);
console.log(adjective);

document.write(story);

The way Dave does the program in his solution video (and the way you're doing it) is the simplest and best way to make this program. You can't get any better code than that.

R R
R R
1,570 Points

Thanks, Marcus. When I first learned actionscript, I picked up a bunch of bad habits. Trying to avoid that now. Appreciate the feedback.

No problem! Did you have any more questions about it?

1 Answer

R R
R R
1,570 Points

not immediately. I plan on revisiting all the challenges soon and will probably have more questions then. It'd be nice there was a link to just the challenges for those wanting a quick review, but that's a question for support. Thanks so much for the help.

Absolutely, R R! I, and many other helpful students, are here to...well...help! haha Happy Coding! :)