Build a Sentence Maker - Build a Sentence Maker

2025-03-11T00:00:00Z

/* I have an issue regarding the console.log() statements. It keeps throwing an error saying that I need to log the firstStory and secondStory in a given format. */

let adjective = "muscular";
let noun = "man";
let verb = "sneezing";
let place = "6-storey mansion";
let adjective2 = "big";
let noun2 = "sambal bajak";

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

console.log("First story: " + [firstStory] + " ");

adjective = "young";
noun = "woman";
verb = "sliced";
place = "boarding room";
adjective2 = "thin";
noun2 = "Thai chili";

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

console.log("Second story: " + [secondStory] + " ");

why are you putting firstStory in an array?

Yes, I also tried taking out the square brackets before but it still said that I needed to log it again.

  1. You should log your first story using the message
    “First story: [firstStory]”

  2. You should log your second story using the format
    “Second story: [secondStory]”

I think those are just indicating that those words need to be replaced by he variable value.

Can you provide a link to this lab?

Yes, I’m aware. This is my updated code, yet the system tells me the same exact things as before.

let adjective = "muscular";
let noun = "man";
let verb = "sneezing";
let place = "6-storey mansion";
let adjective2 = "big";
let noun2 = "sambal bajak";

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

console.log("First story: " + firstStory + " ");

adjective = "young";
noun = "woman";
verb = "sliced";
place = "boarding room";
adjective2 = "thin";
noun2 = "Thai chili";

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

console.log("Second story: " + secondStory + " ");

The console should print what I exactly typed in my firstStory and secondStory declarations with all the concatenations replaced by the values I initiated.

an other thing to consider is, you are adding a space after the story, are you asked to do that?

code removed by moderator

Use this template and just change variable names. I went through the same errors. it just seems to be a spacing issue.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Never mind. I already managed to solve it. The sentences of each story had to be indented. Thanks!