Basic JavaScript: Word Blanks31

Tell us what’s happening:

Your code so far


function wordBlanks(dog, big, ran, quickly) {
  // Your code below this line
  var result = "";
 result+= "My "+"big"+" "+"dog"+" "+"ran"+" very "+"quickly"+".";

  // 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

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

what thus mean i cant understand this( 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).mea

You are hardcoding all words, instead you need to use variables, so that whatever are the values passed in those variables the phrase changes

1 Like

You’ll need to reset the code and start again for this to work as planned. The function “wordBlanks” takes several parameters, which need to be returned from the function in a string.

Whilst the logic behind your code is correct, you need to use a combination of the arguments passed to the function (myNoun, myAdjective, etc.) and strings instead of hard-coding the entire result.

1 Like

Got it . . Thanks a lot !

i understood … Thanks alot