Welcome to the Treehouse Community
Looking to learn something new?
William Murakaru3,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");
Calin Bogdan14,921 Points
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!