Build a Teacher Chatbot - Step 9

Tell us what’s happening:

For build a teacher chatbot step 9 I am stuck on how to put the code I put it as console.log(Here is an example of accessing the first letter in the ${subject}.); and it keeps coming back as an error please help

Your code so far

console.log("Hi there!");

const botName = "teacherBot";

const greeting = `My name is ${botName}.`;
console.log(greeting);

const subject = "JavaScript";
const topic = "strings";

const sentence = `Today, you will learn about ${topic} in ${subject}.`;
console.log(sentence);

const strLengthIntro = `Here is an example of using the length property on the word ${subject}.`;
console.log(strLengthIntro);

console.log(subject.length);

console.log(`Here is an example of using the length property on the word ${topic}.`);
console.log(topic.length);


// User Editable Region

console.log(`Here is an example of accessing the first letter in the ${subject}.`);



// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36

Challenge Information:

Build a Teacher Chatbot - Step 9

Hi @215685,

You message is missing something. Try to copy/paste from the instructions and replace the subject variable.

Happy coding!

What exactly do I replace the subject variable with? Like say I made my subject be JavaScript then do I put JavaScript instead or what?

You had your subject variable coded correctly inside the template literal, but the message itself was missing something. That’s why I thought it would be easier for you to just copy/paste that message and replace only what needed to be replaced.

Yeah, I get that, but I’m confused about what I need to replace the [subject] with and like what that looks like. I’m sorry

Ok I’m sorry I figured it out

I guess I’m not being clear.

This code:

is okay except that your message is missing a word.

Look carefully at this message in the instructions:

Here is an example of accessing the first letter in the word [subject].

Please compare. Do you see what is missing?

the ${} is missing right?

No, that part is right. Try reading the message in your code out loud, then reading the message in the instructions out loud. Your code is missing a word.