Tell us what’s happening:
I cannot figure out the second part of this.
Your code so far
var myNoun = "dog ";
var myAdjective = "big ";
var myVerb = "ran ";
var myAdverb = "quickly ";
var result = "The " + myAdjective + myNoun + myVerb + myAdverb + “to me.”;
This is correct for the first part
the second part is
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).
This is what I am given
// Change the words here to test your function
wordBlanks(“cat”, “little”, “hit”, “slowly”);
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var myNoun = "dog ";
var myAdjective = "big ";
var myVerb = "ran ";
var myAdverb = "quickly ";
var result = "The " + myAdjective + myNoun + myVerb + myAdverb + "to me.";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("cat", "little", "hit", "slowly");
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:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/