are the directions telling me to provide 8 variables for the function? (the dog…and the cat, 4 each). The directions are ambiguous. I mean, the JS itself is fairly simple. I can write working code that’ll run in brackets or the chrome developer, but FCC is looking for something very specific. The directions, like 3/4 of all the other problems read like they’re written by someone who didn’t take the time to convey expectations. I could have completed the entire course by now but 90% of my effort is spent on parsing the directions.
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = " ";
result += " my " + myNoun + " is " + myAdjective + " and he "+ myVerb + " very " +myAdverb;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks(“dog”, “big”, “ran”, “quickly”);
What am I misunderstanding , given this code…BTW, I’m not using curly quotes. The problem wants me to pass in 8 string literals into 4 function variables. Are we supposed to loop through the function twice?
thanks for the quick response.
the following is what I get when I run the code above:
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).
wordBlanks(“cat”, “little”, “hit”, “slowly”) should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
wordBlanks(“cat”, “little”, “hit”, “slowly”) should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
First of all the challenge itself is not clear with poorly framed and confusing question. Despite reading multiple times I don’t understand what the question expects. Can the FreeCodeCamp look after this question and change it?
I saw few feedbacks asking to use the following: (but did not work)
result+= “My “+myAdjective+” “+myNoun+” “+myVerb+” very “+myAdverb+”.”;
So I used the following and it worked:
return ("The " + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb);
{note: you need to delete “return result” before executing}