Mad lib challenge

Whats wrong with my mad lib ?

var result = "The" + "dog," + "had" + "big" + ", jaws" + " and " + "ran" + "very," + "quickly";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.107.

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

The function has parameters.

wordBlanks(myNoun, myAdjective, myVerb, myAdverb)

Whatever is actually passed as those parameters gets used in the function, so if you call the function like wordBlanks("dog", "big", "ran", "quickly"), then inside the function

myNoun will be replaced with “dog”
myAdjective will be replaced with “big”
myVerb will be replaced with “ran”
myAdverb will be replaced with “quickly”

You’ve just hardcoded a string, so if I call your solution like wordBlanks("dog", "big", "ran", "quickly"), it will return " Thedog,hadbig", jaws and ranvery,quickly". And if I call your solution like wordBlanks("cat", "small", "walked", "gracefully"), it will return " Thedog,hadbig", jaws and ranvery,quickly". And so on.

1 Like

You have to use myNoun, myAdjective, myVerb, myAdverb instead of just use “dog”, “big”, etc.

1 Like