Build a String Inspector - Step 6

Tell us what’s happening:

hi everyone :slight_smile:

so, i’ve typed in the other two template literals the same way and I just don’t see the mistake yet

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");
console.log(`fccSentence.includes("freeCodeCamp") returns ${hasFreeCodeCamp} because the word "freeCodeCamp" is in the sentence.`);

const hasJavaScript = fccSentence.includes("JavaScript");
console.log(`fccSentence.includes("JavaScript") returns ${hasJavaScript} because the word "JavaScript" is not in the sentence.`);


// User Editable Region

const hasLowercaseFCC = fccSentence includes("freecodecamp");

console.log(fccSentence.includes("freecodecamp") returns ${hasLowercaseFCC} because includes is 
case-sensitive.

// 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 6

Hi @lotusbear

SyntaxError: unknown: Missing semicolon. (14:35)

  12 | // User Editable Region
  13 |
> 14 | const hasLowercaseFCC = fccSentence includes("freecodecamp");
     |                                    ^
  15 |
  16 | console.log(fccSentence.includes("freecodecamp") returns ${hasLowercaseFCC} because includes is 
  17 | case-sensitive.

There is a message in the console.

Happy coding

you should review about template literals, you are missing something really important

i’ve reviewed it,

const hasLowercaseFCC = fccSentence.includes(“freecodecamp”);

console.log (`fccSentence.includes("hasLowercaseFCC") because includes is case-sensitive`);

what do you think ?

Where did the variable go?

Then use either a template literal or string concatenation to log the message fccSentence.includes("freecodecamp") returns <hasLowercaseFCC> because includes is case-sensitive. to the console.

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

I used template literals and the variable becomes ${hasLowerCaseFCC }

I did add backticks to the console message right before the fccSentence and at the end

what am I missing ?

const hasLowercaseFCC = fccSentence.includes(“freecodecamp”);

console.log(`fccSentence.includes(“hasLowercaseFCC”) because includes is case-sensitive.`);

“`fccSentence.includes(“hasLowercaseFCC”) because includes” isn’t something missing here? Where is “returns” and the variable output?

Maybe it’s geting removed because you aren’t formatting your code with triple backticks for the forum?

What does your output look like?

Does that look ok to you?

Do you have a space between the $ and the {hasLowecaseFCC} ?

This is the same thing you’ve done in the previous steps, right? Compare with the previous lines

i have space in the other one as well

You should not have a space.

In the original code you posted, which is actually just seed code, there is no space.

There is something different about them right? One is white and one is orange. Why is that?

thank you for your patience

1 Like