Build a String Inspector - Step 4

Tell us what’s happening:

I’m unsure how template literal or string concatenation relates to this Step, this is what ive wrote ,

Your code so far

const fccSentence = "freeCodeCamp is a great place to learn web development.";

console.log("Here are some examples of the includes() method:");

const hasFreeCodeCamp = fccSentence.includes("freeCodeCamp");

// User Editable Region


console.log (fccSentence.includes("freeCodeCamp") returns <hasFreeCodeCamp> because the word "freeCodeCamp" is in the sentence.);


// User Editable Region

Your browser information:

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

Challenge Information:

Build a String Inspector - Step 4

You need to combine “strings in quotes” with variables.

Words in brackets like <hasFreeCodeCamp> means they need to be replaced with the variable values.

Use template literals or string concatenation to do this.

You should have a string in the console.log

1 Like

thanks

console.log(`fccSentence includes (“freeCodeCamp”) returns (`${hasFreeCodeCamp}`) because the word “freeCodeCamp” is in the sentence.`);

Am I meant to add anything else?

please review how String interpolation works.

That doesn’t look like the correct sentence to me.

Double check what string you are meant to return

I’m not familiar with the word returns, does it mean the result of the console.log ?

finally got there in the end :slight_smile:

console.log(`fccSentence.includes(“freeCodeCamp”) returns ${hasFreeCodeCamp} because the word “freeCodeCamp” is in the sentence.`);

thank you pkdvalis

1 Like