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 Solution

Is there a way to put a space between variables in document.write.

For example in this challenge if your sentence was more basic and you wanted to write adjective + noun variables in a sentence without a string of words in between.

1 Answer

You can always just add a space in the same way you combined the two words:

  var sentence = adjective + " " + noun;

At first I saw your answer and I was like nope tried it doesn't work, than I saw where I went wrong, I didn't have the + sign before the noun only after the adjective. Thank you, it worked!