Tell us what’s happening:
Your code so far
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var name = "The";
var name1 = "ate";
var name2 = "mouth";
// Your code above this line
return result= name + myNoun + name1 + "my food and " + myVerb ;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks
@decemberman
I would suggest you debug your code and see where the errors lie. A hint is to go over the sentence and see where spaces are missing between words.
Thank you for your reply but i will appreciate a hint.
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var name = “The”;
var name1 = “ate”;
var name2 = “mouth”;
// Your code above this line
return result= name + myAdjective + myNoun + name1 + " my food and " + myVerb + myAdverb;
}
// Change the words here to test your function
wordBlanks(“dog”, “big”, “ran”, “quickly”);
I suggest you start over, change code only between the comments that says so. You don’t need to create any other variable, modify only the var result = ""
line.
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = "";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
```
Thanks
not working
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = “my” + myAdjective + myNoun + “can” + myVerb + myAdverb ;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks(“dog”, “big”, “ran”, “quickly”);
That’s the idea. But now you’re using smart quotes, those won’t work for code. Replace all instances of “
and ”
with "
, don’t type your code in any software that uses smart quotes, like word.
Still, your code is not correct. It asks you to separate every variable with non-word characters, for example, spaces, comma, etc.
Let me give you an example:
"My " + myNoun + " is " + myAdjective + ", it " + myVerb + " " + myAdverb;