Not able to input two Word Blanks

Not able to input two Word Blanks
0

#1

Tell us what’s happening:
I didn’t understand the exercise at all!!
When I gave the input of cat it shows that the dog wordblank is missing and vice-versa.
please help!!!

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "little" + " cat" +  " hit" + " slowly";

  // 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/68.0.3440.59 Safari/537.36.

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


#2

You are not using any of the arguments that are being passed into your function. You should be using all of them.


#3

Thnx for pointing out my mistake!!
I saw the solution though and i didn’t get the part where we are adding + inside the string…

The solution was:


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
    var result = "";
    // Your code below this line
    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");

#4

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#5

The + isn’t inside the string. That person did not use spaces to improve readability. The string literals in that example solution are "My ", " ", " ", " very ", and “.”. The +s are concatenation operators.


#6

Thanks for the info!


#7

I got it my bad!!
Have to be careful from now on wards.