Help! Build a Sentence Maker - Build a Sentence Maker

Tell us what’s happening:

I’ve tried everything, checked all spaces and code structures, rewrote all the code twice. I even tried asking chatgpt and all the changes it made also do not pass. There is an issue with the story structure on lines 15, 16, 24, and 25, apparently. Can anyone help me out here? Thank you

Your code so far

// Story one variables
let adjective = "frightening";
let noun = "dragon";
let verb = "angry";
let place = "cave";
let adjective2 = "large";
let noun2 = "sheep";

// First story
let firstStory =
  "Once upon a time, there was a " + adjective + " " + noun +
  " who loved to eat " + noun2 + ". " +
  "The " + noun + " lived in a " + place +
  " and had " + adjective2 +
  " nostrils that blew fire when it was " + verb + ".";

// Log first story (POINT 16)
console.log("First story: " + firstStory);

// Reassign variables for story two
adjective = "tiny";
noun = "mouse";
verb = "happy";
place = "hole";
adjective2 = "small";
noun2 = "cheese";

// Second story
let secondStory =
  "Once upon a time, there was a " + adjective + " " + noun +
  " who loved to eat " + noun2 + ". " +
  "The " + noun + " lived in a " + place +
  " and had " + adjective2 +
  " nostrils that blew fire when it was " + verb + ".";

// Log second story (POINTS 24 & 25)
console.log("Second story: " + secondStory);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a Sentence Maker - Build a Sentence Maker

ChatGPT doesn’t actually ‘know’ what to. I would skip this and ask real humans.

Lines? Or tests?

The tests don’t like this being split across so many lines. Put it all on one line.

1 Like

Once upon a time, there was a(n) [adjective]

Also, please make sure you have not made any changes to the original template string provided. Only the variables should be replaced.

After this exercise, I think you’re really going to appreciate learning about template literals and string interpolation. :wink: It’s coming up soon in your coding journey: Working with Strings in JavaScript - What Are Template Literals, and What Is String Interpolation? | Learn | freeCodeCamp.org

1 Like

Ah, thank you! It was the “a(n)” that was the only issue. I guess I thought that it was optional, depending on what word I chose. I’ll be more careful next time! :grin: