Trouble with String

Tell us what’s happening:
var myNoun = “dog”;

var myAdjective = “big”;

var myVerb = “ran”;

var myAdverb = “quickly”;

// Only change code below this line

var wordBlanks = "The " + “big” + " " + “dog” + " " + “ran” + " " + “quickly” + “.” // Change this line
Don’t understand whats wrong with this code. Please help me to correct.
// Only change code above this line

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 " + "big" + " " + "dog" + " " + "ran" + " " + "quickly" + "." // Change this line
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36.

Challenge: Word Blanks

Link to the challenge:

Hi @babu1

You just need to add the variables that you created into the wordBlaks variable, for example:( Note: remember to add + to each variable to concatenate )

var myAdjective = "big";
var wordBlanks = "The " + myAdjective ;
console.log(wordBlanks);
// output:  the big 

Sorry, imendieta, nothing is working for me. it’s coming up the same answer which is: You should not directly use the values “dog”, “ran”, “big”, or “quickly” to create wordBlanks .

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).

Please help writing the whole thing, please. It’s frustrating.

It’s ok don’t worry, I did not know too. You just need to pass the variables you created, to the string so you can concatenated the variables together instead of the words .

This should be done like this. Let us know if you understand. I will blur spoiler so you can type and learn what i did, if you have questions again let us know. Hope this helps a bit and light up your problem.

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

// Only change code below this line
var wordBlanks = "The " + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + "." // Change this line
// Only change code above this line
console.log(wordBlanks); // output:  The big dog ran quickly.

No nothing I see hear. Ok ill wait if any one has this answer. I am stuck. I tried several ways nothing worked. Thank you for trying.

I have send you the full work out problem as it’s described on your lecture. That one works perfectly and I have no problem With it. Not sure what are you really asking to do since I already give you the answer to the problem.

Ok thank you; No for some reason your answer did not come through. Anyway, finally I got it. Same answer I was wrote before but it denied. It’s ok now. Thanks for your help.

var wordBlanks = "The " + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + “.”

It did not came out because it’s blur spoiler I did it on purpose for you to click on the code and see the code but not copying paste. It’s for you to work and write the program. Hope it helped.

Note: when your trying to write code try to Preformatted code for other developers to access your code more easily. Just a rule of thumb.

Preformated means like the following:

var wordBlanks = "The " + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + “.”

Means this format.

var wordBlanks = "The " + myAdjective + " " + myNoun + " " + myVerb +
" " + myAdverb + “.”

Ok got you, but I need to figure it out how to do that.

Not in a hurry, but if you will get chance, please, just write me down how to do that. Thank you very much for everything.

Ok I did figure out how to read your unreadable codes. Thanks. If I copy and paste from working screen, it will become auto preformate, right?