I am stuck at this code, can someone help me, here’s my code.
Instructions : 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.
JavaScript :
const myNoun = “dog”;
const myAdjective = “big”;
const myVerb = “ran”;
const myAdverb = “quickly”;
// Only change code below this line
const wordBlanks = “That " + myNoun + " is very” + myAdjective + “but as he saw my cat he got scared and” + myVerb + “away very” + myAdverb + “.” ;
I suggest using this example below, which is the example for this lesson, as guidance on how to build the sentence. This is a bit confusing. But, I found using the example as guidance helped me move beyond the Word Blanks.
const sentence = "It was really " + "hot" + ", and we " + "laughed" + " ourselves " + "silly" + ".";
I hope it can help you through to the next lesson.
your code is correct but i think the instrunction is to seperate the variables by non-word characters, so to add the empty spaces you must add an string that contains a single space character " ".
const sentence = variable + " " + another vairable