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

William Murakaru
William Murakaru
3,525 Points

How do I add space between 'fox' and 'jumps' when I run the code. I was unable to add the space. kindly assist.

<!doctype html> <html lang = "en"> <head></head> <body> <script src = "scripts.js"></script> </body> </html>

// The quick brown fox jumps over the lazy dog

console.log("start the program"); var noun =prompt("please write a noun"); var sentense = "The quick brown " + noun; var verb = prompt("please type a verb"); sentense += verb + " over the lazy dog"; alert ("you are all done!"); document.write(sentense); console.log("program finished");

1 Answer

Calin Bogdan
Calin Bogdan
14,921 Points

Howdy!

Your sentense variable is basically made of "The quick brown " + "fox" + "jumps" + " over the lazy dog" which results into The quick brown foxjumps over the lazy dog.

You have to add a space between the noun and verb variables, like so:

"The quick brown " + noun + " " + verb + " over the lazy dog;

Hope it helped!