Word Blanks SOS

I am struggling with getting the second sentence done i dont get what im doing wrong

Your code so far

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
  var result ="The"+"myNoun" +"was"+"myAdjective" +"and" +"myVerb" +"very"+"myAdverb.";
  console.log ="My"+"myNoun"+"is"+"myAdjective"+"and"+"myVerb"+"the floor"+"myAdverb.";    
  // Your code above this line
  return result= "The dog was big and ran very quickly";
} "My cat is  little and hit the floor slowly";

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
wordBlanks("cat","little", "hit","slowly");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36.

Link to the challenge:

Hi @Zamawelase! Welcome to the community!

The problem is that you are quoting the parameters instead of calling them. “myNoun” returns the string “myNoun”, if you want myNoun’s content you have to write it without quotes.


var result = "myNoun"; //returns "myNoun"
var result = myNoun; //returns whatever is inside the parameter.

it gives me a SyntaxError: unknown: Unexpected token (4:78) error every time i remove the quotes .im confused as to how to write the second sentence using the wordBlanks (cat,little etc.

You don’t need to wrap your variable in quotation marks.
You can set result to

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  // Your code below this line
 var result = "The " + myAdjective +  " " + myNoun + " " + myVerb + " very " + myAdverb + '.';

  // Your code above this line
  return result

you need to put a space in between the word variables so it flows like a sentence and it can be passed dynamic (different) values each time and return a new sentence. You also could use a template literal to add the spaces in one string with these kind of ticks `` found by the tilde. Here’s an example that way.

var result = `The ${myAdjective}  ${myNoun} ${myVerb} very ${myAdverb}.` 

The variables are in the string and are identified within the ${} delimiters

I agree with all of the above answers. It is also worth noting that your console.log method is not structured correctly. It should have a bracket after it:

Or since you assigned the above value to the variable result:

Bear in mind that the console.log() method is not necessary here. It only allows you to check the output in the console and not produce a result of the function (that is what the ‘return’ statement is for).

Keep at it! Once you get your head around the concepts it will become almost second nature to you. Many of us have been there (and probably ripped out a lot of hair in the process).