Word Blanks - answer not accepted, even though it's similar to the solution

Tell us what’s happening:

My code is similar to the correct solution, but I am getting an error. I don’t know where I am going wrong.

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "";
  result = "My hairy and " + myAdjective + myNoun + "loves to " + myVerb + myAdverb + "with me.";

  // Your code above this line
  return result;
}

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0.

Link to the challenge:

Just realised that there are a few spaces missing between the variables. My answer was accepted once I added in the spaces.

You were making exactly the same mistakes as I was earlier today :smile: was just staring at it for half an hour thinking “WTH am I missing!”. Then I realised I was literally missing a space.

I don’t where if/when FCC covers template literals but this is how I would do it.

var result = `My hairy and ${myAdjective} ${myNoun} loves to ${myVerb} ${myAdverb} with me.`;

Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Much much later, this is the point in which you are starting to work on strings and erring a feeling of variables

1 Like