Basic JavaScript - Word Blanks

Tell us what’s happening:
Describe your issue in detail here.
I am struggling to see the error I have in my code here.

The error I get is:
" Failed: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 of your choice)."

Your code so far

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

// Only change code below this line
const wordBlanks = "I have a " + myNoun + " And it is " + myAdjective + " yesteray it" + myVerb + " so" + myAdverb + " it fell to the ground"; // Change this line
// Only change code above this line

console.log(wordBlanks);

Your browser information:

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

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

You have a console.log in your code, so you should be able to see what your string value is. Check it carefully and you should see where there are problems with missing spaces.

console.log(wordBlanks); ?

I included that and had to remove it after the error persisted

Yes, that is not causing your code to fail. It’s the construction of the string itself which is faulty. Put the console.log back in again and have a look.

I just did that now,I still have an error. I watched the video few times and I still get the error


const myAdjective = "big";

const myVerb = "ran";

const myAdverb = "quickly";

// Only change code below this line

const wordBlanks = "I have a " + myNoun + " And it is " + myAdjective + " yesteray it " + myVerb + " so" + myAdverb + " it fell to the ground"; // Change this line

// Only change code above this line

console.log (wordBlanks)```

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 of your choice)."

When I console.log your string it prints the following:
“I have a dog And it is big yesteray itran soquickly it fell to the ground”

Can you see where there is a problem with spacing?

1 Like

The problem was my spacing. This error took me an hour to rectify :roll_eyes: :cold_sweat:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.