Tell us what’s happening:
I just started using Javascript and I feel like I have a good understanding of it so far. This task, however, I am not sure I understand.
I tried making a fill-in-the-blank like the example shown.
I am told that my wordBlank should contain all the words used, as well as my own, but I do not see how that is possible since I am to only write in one line.
I tried looking the answer up, as well as watching the video, but their programming just seems way different. They make a variable called “result” and create a function as well, though the task does not mention it at all.
This is how their answer is:
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = “”;
// Your code below this line
result +=
"My " +
myAdjective +
" " +
myNoun +
" " +
myVerb +
" very " +
myAdverb +
“.”;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks(“dog”, “big”, “ran”, “quickly”);
And this is how mine looks (so to me it just seems like different tasks, though they really are not):
Your code so far
var myNoun = “dog”;
var myAdjective = “big”;
var myVerb = “ran”;
var myAdverb = “quickly”;
var wordBlanks = “the” + myAdjective + myNoun + myVerb + myAdverb; // Only change this line;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
.
Challenge: Word Blanks
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/word-blanks