Basic JavaScript - Word Blanks

Tell us what’s happening:
pls whats wrong with the code.

Your code so far

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

// Only change code below this line
const sentence = "The " + "big " + "dog " + "ran " + "quicky" + "."; 
const wordBlanks = "The";

// Change this line
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

you need to use the variables myNoun, myAdjective, myVerb, and myAdverb with the string concatenation operator + to build a string and assign to the variable wordBlanks

In addition to what @aynuman19 said, you can also do it using template literals (backtick symbols, usually located to the left of the 1 key on your keyboard).

So you could do…

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

`The ${myAdjective} ${myNoun} ${myVerb} ${myAdverb} .`

Template literals are often easier to use than concatenation. To use your variables you just wrap them like so ${myVariable}

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.