Basic JavaScript - Word Blanks

Tell us what’s happening:
Describe your issue in detail here.

Keep getting stuck on wordBlanksshould contain all of the words assigned to the variablesmyNoun,myVerb,myAdjectiveandmyAdverb` separated by non-word characters (and any additional words of your choice).

   **Your code so far**
const myNoun = "dog";
const myAdjective = "big";
const myVerb = "ran";
const myAdverb = "quickly";
// Only change code below this line
const wordBlanks = ""; // Change this line

// Only change code above this line
const result
= "My" + myNoun + " is very " + myAdjective + " but he " + myVerb + " so " + myAdverb + "."; 


console.log(result)


   **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

const result
= " My " + myNoun + " is very " + myAdjective + " but he " + myVerb + " so " + 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 of your choice).
// tests completed
// console output
My dog is very big but he ran so quickly.

need some help thank you…

This is not what I see in the console when I add your code, I see

Mydog is very big but he ran so quickly.

You are missing a space

You need to keep the variable wordBlanks and not use result

i changed it now, still getting 3 out of the 4 check marks. just missing

  • 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).

// tests completed
// console output
My dog is very big but he ran so quickly.

can you post your last code?

const result= " My " + myNoun + " is very " + myAdjective + " but he " + myVerb + " so " + myAdverb + " . ";

didn’t you said you changed it? you need to use the given variable, not result

when i use const wordBlanks , get the following error, SyntaxError: unknown: Identifier ‘wordBlanks’ has already been declared. (9:6)

Your const wordBlanks must have the value of your const result… The freeCodeCamp algorithm is looking for the value of wordBlanks, not result:

const wordBlanks
= "My " + myNoun + " is very " + myAdjective + " but he " + myVerb + " so " + myAdverb + “.”;

The change above should fix your problem, but you can add this code too:

wordBlanks = result;

Good luck :wink:

Ok, you can erase your first wordBlanks declaration, that may fix the problem :+1:

That error appears every time you do something like this:

const a = 0;
const a = 1;

A const can’t be changed in that way, 'cause is designed to throw an error everytime you try to mutate it.
So, in brief, your const wordBlanks can only be declared one time. Excuse me if I don’t explain myself very well… The main reason is that my English is not very good xD

You can’t have an empty const variable, const should always be assigned a value

You ignored the code comments in the starting code.

// Only change code below this line
const wordBlanks = ""; // Change this line
// Only change code above this line

All you need to change is the "" string.

1 Like

You have to change the
const wordBlank =‘’; line