Word Blanks issues

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

// Only change code below this line
var wordBlanks = "The" + myAdjective + "and fat" + myNoun + "immediately" + myVerb + "and"+ myAdverb + "grab a stick"; // Change this line
// Only change code above this line

Result~

“The” + big + “and fat” +dog + “immediately” + ran + “and”+ quickly + “grab a stick”;

can u tell me whats the problem in it i am doing it several times after taking hint but i forgot it easily can u pls tell me the esiest way of solving it :confounded:

Hi @Rosley,

remember that tests check for strict equality, so for example:

a = "I am Batman"
b = "I amBatman"

When compared will be marked as different:

a === b // false

Because spaces and punctuation matter.

So remember that when you concatenate a string, JS will simply “glue” together what you had at the start:

a = "Hi"
b= "Tom"

a + b // "HiTom"

Hope it helps :sparkles:

@Marmiz i think it will work but , its so much like a quiz
did u meant like my code was a bit bad , or full of mistakes?
thank u for replying me (even if i didnt understand).
and i hope it WILL WORK.
actually im a newbie.
its just showing this thing.
// running tests

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). // tests completed

@Rosley, what part did you not understand?
I can try to explain it better. What’s confusing you?

the thing which is confusing me is when do we add “additional words in your madlib” and when do we add “myAdjective etc.”

@Rosley read the test description closely:

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

The requirements then can be boiled down to 2:

  • having all the words assigned in the variables
  • having them separated by non-word (ie spaces).

Try going back to your original code and ask yourself:

“am I using all the variables?”
“am I separating them with spaces?”

1 Like

so the most important in the coding of that type are only those two?
WOW :partying_face: that was preety easy .
thanks alot. @marmiz

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

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