Having trouble with the Basic JavaScript: Word Blanks

Tell us what’s happening:
I’ve added all of the variables however, the results are still saying that I don’t have them all down. please help! thanks

var myNoun = “dog”;

var myAdjective = “big”;

var myVerb = “ran”;

var myAdverb = “quickly”;

var wordBlanks = “The”+ myAdjective + myNoun + myVerb +

// Only change this line;

myAdverb;

// running tests

wordBlanks

should contain all of the words assigned to the variables

myNoun

,

myVerb

,

myAdjective

and

myAdverb

separated by non-word characters (and any additional words in your madlib). // tests completed


Your code so far


var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";

var wordBlanks =  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.90 Safari/537.36.

Challenge: Word Blanks

Link to the challenge:

Read the instructions carefully:

You will also need to account for spaces in your string, so that the final sentence has spaces between all the words. The result should be a complete sentence.

when I add the spaces, nothing is checked.

now you are getting an error because of wrong syntax

if you notice where the error is indicating, you are missing the concatenate operator between a few of the strings

Also, note that "" is an empty string, not a space

if you would post your code instead of a screenshot it would be much easier to help you.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

Putting the quotes in won’t automatically put a space in with it. Try putting the space between each set of quotes where you would expect it to appear in the output.

example: var wordBlanks = “The” + " " + myAdjective + " " + myNoun + " " + myVerb…

var wordBlanks = "The "+ " " myAdjective +" " myNoun +" " myVerb +" " myAdverb + ".";


var wordBlanks = "The "+ " " myAdjective +" " myNoun +" " myVerb +" " myAdverb + ".";

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

syntax error - you are missing something between " " and myAdjective, the concat operator (+), you are missing it in other places in that line too

1 Like

omg THANK YOU!!! i will never forget that now! lol