I can not figure out why this code won’t run, can someone look and give me a clue?
Your code so far
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
// Only change code below this line
function wordBlanks(myNoun, myVerb, myAdjective, myAdverb) {
var result = "";
result += "The " + myAdjective + "" + myNoun + "" + myVerb + " across the lot " + myAdverb + " to play.";
return result;
}
// Change this line
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36.
wordBlanks should contain all of the words assigned to the variables myNoun, myVerb, myAdjective and myAdverb separated by non-word characters (and any additional words in your madlib).
// tests completed```
Sorry for the late reply @Tashaf, glad you could pass it.
Just for reference the challenge could have been done with a function as you originally started, the only important thing is that the wordBlanks variable would hold the correct value.
For example:
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
function createString() {
// do your magic here
return `I am just an example`;
}
wordBlanks = createString();