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 Solution

What's wrong with my code?

var adjective = prompt('Please type an adjective'); var sentence = "There once was a " + adjective; var verb = prompt('Please type a verb'); var noun = prompt('Please type a noun'); alert('All done. Ready for the message?'); sentence += ' girl who loves to ' + verb; sentence += ' and thinks she is a ' + noun + .'; document.write(sentence);

4 Answers

You are missing a quote mark on the line before the document.write.

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

var sentence = "There once was a " + adjective; 

var verb = prompt('Please type a verb'); 

var noun = prompt('Please type a noun'); 

alert('All done. Ready for the message?'); 

sentence += ' girl who loves to ' + verb; 

sentence += ' and thinks she is a ' + noun + '.'; 

document.write(sentence);

Yup. caught that lol. Thank you for the quick response!

Charles Wanjohi
Charles Wanjohi
9,235 Points

The last statement should have the fullstop inside single quotes i.e.

 sentence += ' and thinks she is a ' + noun + '.';    //your does not have the fullstop enclosed in single quotes

Hope this helps out

Yup. Ended up doing that. Thank you!