Word Blanks help please astral wolf

Word Blanks help please astral wolf
0

Tell us what’s happening:

Hey guys so I understand how to do this I think I just made a tiny mistake if you could help explain whats wrong and why and how to get the correct answer
Thank you

Your code so far


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

  // Your code above this line
  return result;
}
var sentence = "the" + "dog" + "was really" + "big" + "and he" + "ran" + "quickly" + "away";
// 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

Your function wordBlanks should be using the arguments passed to it (represented by the parameter myNoun, myAdjective, myVerb, and myAdverb) and concatenate these variables (along with some extra filler words) to create a sentence which you will return.

All you have done is declared a variable named sentence outside the wordBlanks function and assigned it the following string:

thedogwasrealybigand herandquickly

The challenge starts with a variable named result which you could use to create a sentence using the variables I mentioned, but you will need to add some spaces or it will not really be a sentence.

Im sorry im still a beginner so Im still confused so whats wrong with what I did and what do I do?

I just told you what was wrong. Your function is always going to return a blank string, because you have not changed the original code which assigns a blank string to the variable named result and then the the variable result is returned.

The challenge instructions (seen below) tell you exactly what to do. No where in the instructions does it tell you to create a sentence variable outside the wordBlanks function.

In this challenge, we provide you with a noun, a verb, an adjective and an adverb. You need to form a complete sentence using words of your choice, along with the words we provide.

You will need to use the string concatenation operator + to build a new string, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb. You will then assign the formed string to the result variable.

You will also need to account for spaces in your string, so that the final sentence has spaces between all the words. The result should be a complete sentence.

Just try to write some new code inside the function. Assign the string (as I described above) to the result variable and it will get returned.

There are also the lines that say “your code below this line”, “your code above this line”, you are not writing inside the function

Tell us what’s happening:

so am I supposed to make a sentence with all the words they give me like this?
or what do I need to do differently?

Your code so far


function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result = "The" + "big" + "dog" + "hit" + "ran" + "quickly" + "into the" + "little" + "cat" + "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/75.0.3770.100 Safari/537.36.

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

the goal of this exercise is creating a string concatenating variables. You need to use the provided variables, myNoun, myAdjective, myVerb, myAdverb and create a phrase around them

plus, careful with creating a string, you are missing all the spaces. Right now result has value of Thebigdoghitranquicklyinto thelittlecatslowly