Basic JavaScript: Word Blanks (Can't pass)

Tell us what’s happening:
I am not sure what is going on. According to the information in front of me, I met all the requirements to pass the tests. The help video showed another way to add things together with " + asdfjaldf + " . I tried formatting that way and nothing. I keep getting a fail on the final check ( 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).) What gives? What am I missing?

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" + " was very " + "myAdjective " + " and " + "myVerb" + " exceedingly " + "myAdverb" + " today" + "."; // 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/85.0.4183.121 Safari/537.36.

Challenge: Word Blanks

Link to the challenge:

here myNoun is not a variable

Then what is it? And/or how do I change it? I don’t understand what the problem is asking me to do. It seems like it just wants me to use the variables in place of the actual words with proper syntax. However, it throws the error " 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)."

Then when I replace the variables with the words, it passes that check and throws the other error " You should not directly use the values “dog”, “ran”, “big”, or “quickly” to create wordBlanks ."

After watching the video, I tried it a different way there. And it still threw an error.

.
You just need to remove the quotes from each myNoun , myAdverb, myVerb and myAdjective. These are variables and do not need quotes. Only strings need quotes.

I can’t believe I missed that. Thanks. That is one mistake I do not believe I will be making again.

1 Like