Basic JavaScript - Word Blanks

Tell us what’s happening:
Describe your issue in detail here.
Says I need words or spaces between all variables.
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 ' +'myNoun'+ ' was ' +'myAdjective'+ ' and ' +'myVerb'+ ' very ' +'myAdverb'+ ' through the forest."; // 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/ Safari/537.36

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

The whole problem here in your code is that you are defining variables within quotes which JS interprets as strings and does not look for the value of that particular variable.
Hope that helps.

So should I use single quotes instead?

There should be no quotes for variable names.
For example:

let user =“John”;
let greetings = "Hello " + user;

In the above scenario we have declared a variable user and we have assigned a value of "John" to it. Then in greetings variable we are concatenating "Hello " string with the user variable defined above it with a + sign and we are just passing the variable user in the greetings variable without any quotes.
That’s how variables are used as a value for other variables.
I hope it is clear now.

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