My dog is Stock in the Word Blanks

Tell us what’s happening:

I don’t know what I am doing wrong. Have read and followed the instructions from the other posts yet I don’t seem to be able to pass the challenge.

Thanks for your help in advance.

Your code so far

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line

var result = "My " + myAdjective + " " + myNoun + " " + myVerb + "very " + myAdverb + ".";

  // Your code above this line
  return result;

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:

hint: problem between myVerb and “very”.
console.log(result) to see the bug yourself.

1 Like

Thanks for your hint! It worked. I was missing " ".

But are the double quotes for creating space between the words only. I thought that space is created on the Mad Lib words by leaving some backspace before closing of the double quote.

1 Like

hi there, anything surrounded by quotes is a string.
space is part of the string if surrounded by quotes space counts in determining string length
=>"" this is an empty string hence string length is 0
=>" " this is a string with space hence string length is 1
=> "abc123" this is string with a characters string length is 6
=> "abc xyz" this string contains space and other characters, hence string length is 7.

so this problem can also be solved by adding space in the string containing very at start like " very" , so:

var result = "My" +" " + myAdjective + " " + myNoun + " " + myVerb  + " very" + myAdverb + ".";

I hope this makes it clear :slightly_smiling_face:

That is a double space.

1 Like

Oh yeah I mistyped that. thank you for the correction. I will edit that.

1 Like