Word Blanks cant seem to get it right

Word Blanks cant seem to get it right
0.0 0

#1

Tell us what’s happening:

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = myNoun + " is " + myAdjective + " and "  + myVerb + myAdverb;

  // Your code above this line
  return result;
}

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/


#2

returns
dog is big and ranquickly
and
cat is little and hitslowly

so you need to add a space in between myVerb + myAdverb


#3

I have the same problem.

I tried the code and used spaces in my own exercise but it still won’t accept.

It keeps saying:
wordBlanks(“dog”, “big”, “ran”, “quickly”) should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
wordBlanks(“cat”, “little”, “hit”, “slowly”) should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).


#4

@eialici

myVerb + myAdverb are two strings without whitespace, so you’ll need a space between them as well.


#5

Thanks a lot. Finally got through it


#6

Sorry but I tried that, still won’t work:

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "My " + myNoun  + "is very " + myAdjective  + "but " + myVerb  + "away " + myAdverb;

  // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
wordBlanks("cat", "little", "hit", "slowly");
wordBlanks("monster", "giant", "smash", "fast");

#7

If you want to add a space between variables, you have to explicitly add the space

var result = var1 + ' ' + var2...

#8

Thanks so much JM, this got it to work.
It’s amazing how closely typo’s can interfere with the soundness of the code.

I am an accountant who wants to move to programmer, in accountancy accuracy is key, but it seems that in programming its even more important :slight_smile: