Word Blanks in basic javascript

Tell us what’s happening:

Your code so far

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

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

Link to the challenge:

You have not written any code and you did not ask a question, so we are unable to help you yet.

what we have to do in this code?

The instructions are below. If you have a specific question about the instructions, just tell us what you don’t understand about the instructions.

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.

the second part of the instruction:
wordBlanks(“dog”, “big”, “ran”, “quickly”) should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
how to perform this task ??

That last part you quoted is not the challenge instructions. That is a test case telling you what a specific call to your function should return.

The following is the function definition:

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {

Each of those words above (myNoun, myAdjective, myVerb, myAdverb) are called parameters.
They are variable names you can use inside your function. What values do these variables have? Well, when a function is called (as seen below), each of those values (“dog”, “big”, “ran”, “quickly”) get passed into the function wordBlanks. Remember those parameters I just mentioned above. Well, those are like placeholders for the values which get passed in.

So what that means is “big” will get passed to the variable myNoune, “big” will get passed to myAdjective, “ran” will get passed to myVerb, and “ran” will get passed to myAdverb. The order and position of these values (which are referred to technically as function “arguments”) matters. Now you can build a string has you have already learned in previous lessons and reference these variables to generate a sentence. You will want to concatenate the variables with other words like “The” or “A” and remember to uses space characters to separate the words and then add some kind of punctuation mark like a period or exclamation point on the end.

wordBlanks("dog", "big", "ran", "quickly");

If you can not remember how to concatenate strings and variable together, review the following previous challenges.




ok thanks :slight_smile: