Word Blanks (This lesson is giving me trouble.)

Tell us what’s happening:

I can’t seem to figure this one out. Can you help? Thanks!!


Your code so far

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "myNoun", "myAdjective", "myVerb", "myAdverb";
  result = "The" + "myNoun" + "is really" + "myAdjective" + "and he" + "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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36.

What your current code is returning right now is this string: “ThemyNounisreallymyAdjectiveandhemyVerbverymyadVerb”

myNoun, myAdjective, myVerb, myAdverb are variables that should return the values passed in through the function. But since your code has them wrapped around quotation marks (“myNoun”), they are returning as strings, not as variables. “myNoun” is not the same as myNoun.

That’s the first issue that needs to be fixed.

Second thing to fix is you need to include spaces so that result is a sentence and not a bunch of words glued together. To fix that, include spaces within the strings ex. "The ".

Also, you don’t need to the first line where you declare result = to the variables, I’m not sure what you are trying to do there. Just do var result and set it = to the second line after fixing it.

1 Like