Build a Teacher Chatbot - Step 8

Tell us what’s happening:

please help me to crack this Now it is time to get the length of the topic string.

You can use template literals inside console statements like this:

Example Code
const developer = “Jessica”;
console.log(Hello, my name is ${developer}.);
Start by outputting the message Here is an example of using the length property on the word [topic]. to the console.

Remember to replace [topic] with the topic variable, and use proper template literal syntax as you did in the previous steps.

Then, add a s

Your code so far


// User Editable Region

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

// 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/133.0.0.0 Safari/537.36 Edg/133.0.0.0

Challenge Information:

Build a Teacher Chatbot - Step 8

Please talk about how you got stuck figuring out what is wrong with the code

Welcome to the forum @wahidhusaindev

Are you getting any messages in the console?

Happy coding

  1. Do not re-declare the topic variable. It is already declared near the top of the file.

  2. length is a property on the string. You can not log out length on its own, that would be a reference error as the identifier length does not exist anywhere in the code.

  3. You are only asked to log out the length of the topic string in the second console.log, nothing more.