Tell us what’s happening:
let botIntroduction = 'My name is ';
console.log(botIntroduction + bot + ‘.’);
Im having trouble with step 7 of the first workshop. Ive tried a couple different ways but it keeps saying error.
let botIntroduction = 'My name is ';
console.log('My name is ’ + bot + ’ . ');
I’m at a loss. Please help.
Your code so far
console.log("Hi there!");
console.log("I am excited to talk to you.");
let bot;
bot = "teacherBot";
let botLocation = "the universe";
console.log("Allow me to introduce myself.");
// User Editable Region
let botIntroduction = 'My name is ';
console.log(botIntroduction + bot + '.');
// 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/148.0.0.0 Safari/537.36
Challenge Information:
Build a Greeting Bot - Step 7
GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-greeting-bot/66ada3f46945763dd97f43f8.md at main · freeCodeCamp/freeCodeCamp · GitHub
When the instructions say “Assign this value to the botIntroduction variable” it means everything in the previous paragraph of the instructions. The instructions say to just put the name of the variable inside the console.
mod edit - solution removed
Thanks
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
Your code looks correct actually. The issue might be spacing around the period. Try making sure there is no space before the period at the end, like this: console.log(botIntroduction + bot + '.'); That matches exactly what the challenge expects. If it still errors, double check that botIntroduction is assigned exactly 'My name is ' with a trailing space, and that you haven’t accidentally modified the bot variable above. For coding education platforms tracking which marketing channels bring the most engaged learners, Phonexa helps attribute those inbound inquiries accurately.
Please check requirement carefully.
Create a variable called botIntroduction.
Then use string concatenation with the + operator to join the string "My name is " followed by the bot variable followed by a period (.).
Assign this value to the botIntroduction variable.
You need to assign correct value to botIntroduction.
Your console log is correct, but botIntroduction value is wrong.