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

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

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!