Basic JavaScript - Word Blanks

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

  • You should not directly use the values dog, ran, big, or quickly to create wordBlanks.

  • Failed: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).
    Your code so far

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

// Only change code below this line
const wordBlanks = "My " + "dog" + "Bruno is very" + "big" + "and" + "ran" + "very" + "quickly"         // 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/115.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Word Blanks

Link to the challenge:

Try adding console.log(wordBlanks) to see what your string looks like… that should help you to see what’s wrong with your spacing.

console.log() is one of the most useful debugging tools at your disposal.

Also, you should be interpolating your variables, not joining together explicitly expressed strings.

EXAMPLE:

let myName = "igorgetmeabrain";
let myGreeting = "Hello, my name is " + myName + "!";
console.log(myGreeting);

Thanks alot that really helped but am still stuck on this i cant understand.

  • You should not directly use the values dog, ran, big, or quickly to create wordBlanks.

  • Passed:wordBlanks should contain all of the words assigned to the variables myNoun, myVerb, myAdjective and myAdverb

If you look at the example I gave you above, that shows how you can build a string from a combination of strings and variables. So, piece your string together using all of the variables which are declared in your code (i.e. myNoun, myAdjective etc).

You build your string using concatenation, using + to add all of the individual elements of the string in a chain, to get the desired result.

Just as you can concatenate two strings explicity (e.g. "hello " + "world"), you can also interpolate variables which have been declared as strings (e.g. "hello " + myAdjective + " world").

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