Basic JavaScript - Word Blanks

now, how to add space and i also not understand diff between “myNoun” and myNoun is seems similar to me.

after removing quotation marks from myNoun there is no space between them, is shown same.
dogranbigquickly

There are spaces added in the example:

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

You need to put spaces in like that. Since you are using variables that hold strings, you will need to add separate strings that just have spaces.

const wordBlanks = "myNoun"  +  "ran" +  "myAdjective"  +  "quickly"; // Change this line
console.log(wordBlanks);

it is not passing after that

Why did you put quotes back around these?

Where did you add the spaces between words?

I am add the space but this is not fulfilled.

  • You should not directly use the values dog, ran, big, or quickly to create wordBlanks.
const wordBlanks = myNoun  +  " ran " +  myAdjective  +  " quickly "  ; // Change this line
console.log(wordBlanks);

This is closer, but you need to use all 4 of the variables you were given

You can’t directly include these words like this.

then , how can include them?

The exact same way you did here - by using the variables you were given


You will need to use the string concatenation operator + to build a new string, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb. You will then assign the formed string to the wordBlanks variable. You should not change the words assigned to the variables.

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.

Think of a variable declaration like an empty box with a label on it.
The label is the name of the box.
const myNoun = "dog"
For eg this can be like a box whose label is myNoun and the content of the box is a string “dog”.

Whenever you want to say “dog” in JavaScript you can refer to it by its variable myNoun.

So writing something like myNoun + "s are my favorite" would give you
dogs are my favorite

these are two statment or task to perform if i fullfil 1st then 2nd not performed and if i perform 2 then 1 is not fulfil requirement.i dont know why this happened from yesterday.
1 * You should not directly use the values dog, ran, big, or quickly to create wordBlanks.

2 *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 of your choice).

What is your code if you only use the variables you were given?

const wordBlanks = myNoun + " ran "  +  myAdjective  +   " quickly "   ; // Change this line
console.log(wordBlanks);

This is not a variable

This is not a variable.

If you do not know what variables are, you may have rushed through the early challenges too quickly

variables are name of storage location just.

Right, so only use the variables, not the strings that were stored in the variables.

What does your code look like with only variables?

const wordBlanks = myNoun   +   myVerb  +  myAdjective  +  myAdverb    ; // Change this line
console.log(wordBlanks);

Ok, so that’s half of the work you need. But you don’t actually have spaces between the words. Extra spaces before and after the + don’t change the addition. You need a small string holding a space between each word.

thankyou soo much .you served alot of time for my help.

1 Like