Having troubles understanding why my code wont work

Tell us what’s happening:

Your code so far

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  var result = "";
  // Your code below this line
var sentence = "I gave my" + "dog" + ", a" + "big" + ", juicy steak" + ", and than he"  + "ran" + ",of " + "quickly";
  // Your code above this line
  return result;

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36.

Link to the challenge:

The whole idea behind this challenge is to learn how to pass values with a function call and have the function use the values passed into it to do something with them.

For example, if I make the call to wordBlanks(“dog”, “big”, “ran”, “quickly”);

Your wordBlanks function has 4 parameters which act as placeholders for the values from the function call, so inside the function myNoun will become “dog”, myAdjective will become “big”, myVerb will become “ran”, and myAdverb will become “quickly”.

So inside the wordBlanks function, you need to use the four variables (myNoun, myAdjective, myVerb, myAdverb) to build a sentence. Your current solution is just a string using none of these variables. Also, make sure whatever variable to which you assign this concatenated string, that you return that variable name. Currently, your function returns the result variable, but result = “”.

If you have any questions about anything I have said, please ask for clarification.

1 Like

thank you i got it :slight_smile: