Build a Sentence Maker - Build a Sentence Maker

Tell us what’s happening:

I am stuck,I am doing everything possible but Im not getting anywhere.

Your code so far

let adjective;
let noun;
let verb;
let place;
let adjective2;
let noun2;

let adjective = "fierce";
let noun = "dragon";
let verb = "angry";
let place = "mountain";
let adjective2 = "huge";
let noun2 = "meat";

let firstStory;
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);

let adjective;
let noun;
let verb;
let place;
let adjective2;
let noun2;
let adjective = "tiny";
let noun = "mouse";
let verb = "excited";
let place = "garden";
let adjective2 = "small";
let noun2 = "cheese";

let secondStory;
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 + ".";
console.log("Second story; " + secondStory);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0

Challenge Information:

Build a Sentence Maker - Build a Sentence Maker

Compare this to your first story. Something missing?

you should review how let works, this is not allowed

let adjective;

let noun;

let verb;

let place;

let adjective2;

let noun2;

adjective = “fierce”;

noun = “dragon”;

verb = “angry”;

place = “mountain”;

adjective2 = “huge”;

noun2 = “meat”;

let firstStory;

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;

noun;

verb;

place;

adjective2;

noun2;

let adjective = “tiny”;

let noun = “mouse”;

let verb = “excited”;

let place = “garden”;

let adjective2 = “small”;

let noun2 = “cheese”;

let secondStory;

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 + “.”;

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

You can only declare a variable once.

down here there are more of those, please review about let

Introduction to JavaScript - How Do let and const Work Differently When It Comes to Variable Declaration, Assignment, and Reassignment? | Learn | freeCodeCamp.org

This theory lecture should help you understand more about what is wrong with your code.

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