Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables The Variable Challenge

Alex Lang
Alex Lang
1,110 Points

What did I do wrong? nothing is working?

var noun = prompt ('Please Type a Noun'); var answer1 = noun;

var verb = prompt ('Please Type a Verb'); var answer2 = verb;

var adjective = prompt ('Please type an Adjective'); var answer3 = adjective;

document.write('<h1>Hello, my name is Gary and I am a "+ answer1 +".<h1><h2>I often like to "+ answer2 +" for my morning exercise.<h2><h3>I am very "+ answer3 +", I hope this does not scare you.<h3>');

alert("Typing up story now!")

var story = answer1 + answer2 + answer3

document.write(story)

1 Answer

Steven Parker
Steven Parker
211,091 Points

It's probably "working" but not doing what you intended. Since in the first "document.write", the entire argument is enclosed with apostrophes ("single quotes"), then everything between them will be shown as-is, quotes and all. If you change the apostrophes on the outside to quotes that match the ones used in the rest, then the quotes and plus signs will not be shown and the variable values will appear instead of the variable names.

Alex Lang
Alex Lang
1,110 Points

I just found out that the "s" in "story.js" was capitalized on accident and messed up everything but now I have it fixed and it works! Thanks for trying to help me! :)

Steven Parker
Steven Parker
211,091 Points

Sometimes the problem can be in a place you don't expect. That's why if possible, always make a "snapshot" of your workspace and post the link to it.