Basic JavaScript - Word Blanks

Tell us what’s happening:
what am I missing? or what am I doing wrong. This sentence doesn’t get accepted by the test results.

Your code so far

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

// Only change code below this line
const wordBlanks = "The "+"myAdjective "+"myNoun "+"myVerb "+"myAdverb"+"."; // Change this line
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

Hi there and welcome to our community!

Try putting console.log(wordBlanks) after you declare this variable, and you’ll see in the console what it’s returning. You’ll quickly learn that console.log() is your best friend when it comes to simple debugging!

HINT: If you want to insert variables into a string you don’t enclose them in quotation marks, because that would turn them into strings. If you want to insert a space into a string, between two variables, you could try variable1 + " " + variable2.

1 Like

Like this…it also doesn’t take.

// Only change code below this line

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

// Only change code above this line

I’ve edited your code 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.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

The issue is that all of your values are strings which is not the goal of the challenge.

The challenge wants you to concatenate variables to strings and build a new sentence.

For example:

const job = "developer"

const sentence = "Jessica is a" + " " + job // this would result in Jessica is a developer

I made a plan to understand. Thank you. I passed the lesson.

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