Word Blanks - please help :(

Tell us what’s happening:

Guys please help :frowning: 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 :frowning:

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.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/

I know grammar of this sentance is incorrect but I tried to add different words between words given , I am just loosing what is going on in here :frowning:

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"

Hope it helps :wink:

thank you for your reply

the way you explain it makes sense but I have no idea how to apply to this challenge.

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

@maggdajohn, do the Relevant Links and Hints in the fCC Guide entry help?

Thanks a lot guys finally I found the solution.

@maggdajohn Awesome! :clap: :clap: Can you share how you figured it out or what helped?

If you need help use the " Ask for help" button yourself

@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 :slight_smile: 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!

1 Like