Basic JavaScript - Word Blanks

Tell us what’s happening:

Describe your issue in detail here.

Confused with how to complete this task, not sure what it is I’ve done wrong or left out.

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" + "myAdjective" + "brother saw a" + "myNoun" + ", and since he had always had a fear, he" + "myVerb" + ", he was no slouch either, he was off" + "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/118.0.0.0 Safari/537.36 Edg/118.0.2088.61

Challenge Information:

Basic JavaScript - Word Blanks

If you type console.log(wordBlanks); you should be able to see what your output is and then you can start to work out was is wrong.

1 Like

I see what the issue is, I just don’t know how to resolve it, my sentence isn’t spaced out correctly around my wordBlanks, it’s clumped together, the words directly before and after my wordblanks, three words in one.

Please show what you get from the console.log?

MymyAdjectivebrother saw amyNoun, and since he had always had a fear, hemyVerb, he was no slouch either, he was offmyAdverb.

I think you should learn more about the String. And I will give you a keyword, hope you know what to do with it. Search for the “template literal” in JavaScript.

Edit: Template Literal is not the only way, but it will the best way to handle Strings in JavaScript.

2 Likes