Guys please help I really do not understand what I need to do… Instructions are very poor, I do not understand how I can use this in future coding… For now I really do not know what to do with the code
Your code so far
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result ="my " + "dog " + "is very " + "big " + "and can " + "ran " + "very " + "quickly" + ".";
// Your code above this line
return result;
}
// 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/72.0.3626.109 Safari/537.36.
This lessons aims to teach you about function arguments.
It’s normal that in a program, you want to perform some action based on some inputs.
Let’s look at a very basic example: a function that reads a name argument and output a greetings.
function sayHello(name) {
return "Hello " + name + ", it's nice to see you again";
}
So that this function will perform our greetings according to the argument provided:
sayHello("Mark") // Hello Mark, it's nice to see you again
sayHello("Juliet") // Hello Juliet, it's nice to see you again
Likewise you should write a function that relies on its argument, instead of return a “fixed” value.
Like in this example
function sayHello(name) {
return "Hello Romeo"
}
// doesn't matter which name I provide, it will always say "Hello Romeo"
Instead of writing the words in the string, use the parameters of the function, like instead of writing "Romeo", you use name
This challenge you need to use string concatenation with variables
@ilenia, I’m curious to know how @maggdajohn figured it out and what helped them because everyone learns differently. I’m curious if any of the responses above helped and/or if there’s another resource that explains it differently that helped.
@maggdajohn doesn’t have to reply if they don’t want to. I’m asking only so I can help others in the future and so others who read this might benefit as well.
oh absolutely, I must admit that my husband helped me and we both made that challenge work We were doing it based on fCC Guide entry that @camper suggested, so the words that were provided we exchanged to “myAdverb”, “myVerb” etc and the rest just filled in. I must say that instructions to this challange are very confusing and only fCC Guide really helped. Thanks everyone!