Can someone explain what im doing wrong

Tell us what’s happening:

Your code so far


var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";

// Only change code below this line
var wordBlanks = "The" + myNoun + "cat" + myAdjective + "small" + myVerb + "walked" + myAdverb + "slowly" + "."; // Change this line
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36.

Challenge: Word Blanks

Link to the challenge:

The test that fails is

wordBlanks should contain all of the words assigned to the variables myNoun, myVerb, myAdjective and myAdverb separated by non-word characters (and any additional words in your madlib).

Consider if your variables are separated by non-word characters. Like in sentences we write how allthewordsarenotlikethis.

1 Like

still not working still stuck

Have you tried adding spaces?
You are missing them.
Try this

var wordBlanks = "The " + myNoun + " cat " + myAdjective + " small " + myVerb + " walked " + myAdverb + " slowly " + "."; // Change this line

Tell us what’s happening:

someone explain this as simple as possible

Your code so far


var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";

// Only change code below this line
var wordBlanks = "cat" + myNoun + "small" + myAdjective + "walked" + myVerb + "slowly" + myAdverb + "."; // Change this line
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36.

Challenge: Word Blanks

Link to the challenge:

1 Like

What exacly you do not understand?

You need to have spaces.

1 Like

Your code currently outputs: catdogsmallbigwalkedranslowlyquickly.
Your code needs to have the words separated by non-word characters (spaces).
Example: cat dog small big walked ran slowly quickly.

I went ahead and combined your posts for you. Please continue your previous thread instead of multi-posting next time. Thank you.

the words are already provided for you (nouns, verbs…). the challenge is to build it into one sentence. I’m not sure why you’re adding your own words (“cat”, “small”…)
in-order to form a proper sentence, you do need space between words, which are not provided, so you have to account for spaces.

i did space them and it said use your own in the directions

Try console.log:

console.log(wordBlanks);

This is a good practice when you can’t figure out what is wrong, and will show you what we’ve all been trying to explain. (You put spaces between the variables and strings but not sufficient spaces in the strings.)

1 Like