Build a Sentence Maker - Build a Sentence Maker

Tell us what’s happening:

when useing let variables in a string sentance and the variables ar in how do you get them to work with console.log

Your code so far

let adjective = "very big"
let noun = "dragon"
let verb = "mad"
let place = "cave"
let adjective2 = "big"
let noun2 = "Berrys" 
let 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(firstStory);

Your browser information:

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

Challenge Information:

Build a Sentence Maker - Build a Sentence Maker

1 Like

with round brackets you use t + before and after

the square brackets are there to show you what you need to replace in the string, you should not have them in your string

1 Like

do i still use the + before and after the variables to get it to read on the console

yes, the way to concatenate strings and variables has not changed so far

let adjective = “very big”

let noun = “dragon”

let verb = “mad”

let place = “cave”

let adjective2 = “big”

let noun2 = “Berrys”

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

console.log(firstStory); didn’t work

make sure to consider spaces when you are concatenating

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

what about here? don’t the adjective and noun also deserve a space between them? you can also look at the sentence printed in the console to double check

1 Like

when i took the brackets of i failed all the test

you are missing a concatenation

it said SyntaxError: unknown: Missing semicolon. (7:105)

because you have two strings next to each other, as there is no +, that’s the error that appear, it does not mean it must add a semicolon to fix it