function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = “The” + myAdjective + " big" + myNoun + " dog" + myVerb + " ran" + myAdverb + " quickly" + " into a wall.";
return result;
}
wordBlanks(“dog”, “big”, “ran”, “quickly”);
This is the error
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).
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0.
You should create a string which includes the arguments received by the function. It is important that there are spaces between all words. You should return the string that is created.
From what i understood you said, i did but both errors showing now, i have no idea
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = “The” + myAdjective + " big" + myNoun + " dog" + myVerb + " ran" + myAdverb + " quickly" + " into a wall.";
return result;
}
wordBlanks(“dog”, “big”, “ran”, “quickly”);
This is the error
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).
Yes its not even letting me run the test now
var result = “The ” + myAdjective + "big " + myNoun + "dog " + myVerb + "ran " + myAdverb + "quickly " + “into a wall.”;
You are not using the parameters of the function properly. The task does not want you to just write a string but to learn how to use parameters and use variables in a string. For example:
let fruit = "apple";
let sentence = "Michael really loves " + fruit + "s";
console.log(sentence); // "Michael really loves apples"
Your string has no spacing between the concatenated variables and the internal words of the string.
You are adding your parameters for the function call into the string inside the function. If you did not pass any values into wordBlanks() it would read fine.
wordBlanks(); // The big dog ran quickly into a wall."
Do not focus only on completing the assignment. Take some time to review your code and understand what and why you are doing. I will share my function and show you how it should work so you have an example to work towards.
wordBlanks("thief", "frantic", "sprinted", "fearfully"); // "The frantic thief sprinted fearfully into a wall".
Thank you, im just gona read about functions and parameters before doing the task with your help.
I knew that what you are sying to me was needed but the way the task is worded i just couldnt figure it out without some help, but i should of googled the function before posting for help which i know now to do in the future, im just going up a level here with js its all very new. Thanks again