Whats wrong with my attempted solution?

Tell us what’s happening:
I’ve worked on this for hours on end and can’t seem to figure it out. I read the answers placed here years ago and read that we/I should learn Algorithims first, but what is wrong with my code?

Your code so far


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

var wordBlanks = "The " + myNoun + "always having " + myAdjective +" eyes, " + myVerb + "to the potty, " + myAdverb + "."; // Only change this line;

Your browser information:

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

Challenge: Word Blanks

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/word-blanks

@theleeat Welcome to the forum!

You are missing some spaces between some words.

I did notice one that I just corrected, still not working. Is the set-up correct. I did notice a couple people using function instead.

You had two missing spaces.

@theleeat Welcome to the forum! @RandellDawson already spotted the issue.
I’m just adding this info, about String Literals.
They allow you to solve the same problem in a cleaner way.
The syntax of String Literals goes like this

`The ${myNoun} always having ${myAdjective} eyes, ....`

This way is easier to spot those missing white spaces!

1 Like