Basic JavaScript: World Blanks

I have successfully been able to get past the Word Blanks tutorial however I’m not sure why my original solution didn’t pass the test and would be grateful for any pointers.

In this tutorial the example given looks like this;

var sentence = "It was really" + "hot" + ", and we" + "laughed" + "ourselves" + "silly.";

From this I originally thought I would basically need to do the following to pass the tutorial;

  var result = "myNoun " + "myAdjective " + "myVerb " + "myAdverb";

This however fails, and although I was able to figure it out, in the end, it bothers me that this didn’t pass and I’d like to know why as it seems to follow the syntax given in the example.

Hi @Andy-R .

“myNoun” returns a 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.

That makes more sense, thanks!