Tell us what’s happening:
In this challenge, we provide you with a noun, a verb, an adjective and an adverb. You need to form a complete sentence using words of your choice, along with the words we provide.
You will need to use the string concatenation operator +
to build a new string, using the provided variables: myNoun
, myAdjective
, myVerb
, and myAdverb
. You will then assign the formed string to the result
variable.
You will also need to account for spaces in your string, so that the final sentence has spaces between all the words. The result should be a complete sentence.
Your code so far
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = "A big dog ran quickly";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("cat", "big", "ran", "quickly");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:64.0) Gecko/20100101 Firefox/64.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks
And this is the criteria i need to meet
wordBlanks("","","","")
should return a string.
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).