Back to Freecodecamp

Step 15

curriculum/challenges/english/blocks/workshop-greeting-bot/66add47d27763c4862492c8c.md

latest2.4 KB
Original Source

--description--

For the final step, you will log the bot's message of "Well, it was nice to talk to you. Have a nice day!" to the console.

And with that, your greeting bot is complete!

--hints--

You should have a console statement in your code.

js
assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log(.*)/g), 9);

Your console statement should log the string "Well, it was nice to talk to you. Have a nice day!".

js
assert.match(__helpers.removeJSComments(code), /console\.log\s*\(\s*["']Well\s*,\s*it\s*was\s*nice\s*to\s*talk\s*to\s*you\s*\.\s*Have\s*a\s*nice\s*day\s*!["']\s*\)\s*/
);

--seed--

--seed-contents--

js
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.");

const botIntroduction = "My name is " + bot + ".";
console.log(botIntroduction);

const botLocationSentence = "I live in " + botLocation + ".";
console.log(botLocationSentence);

bot = "professorBot";

const nicknameIntroduction = "My nickname is " + bot + ".";
console.log(nicknameIntroduction);

bot = "awesomeTeacherBot";

const newNicknameGreeting = "I love my nickname but I wish people would call me " + bot + ".";
console.log(newNicknameGreeting);

const favoriteSubject = "Computer Science";

const favoriteSubjectSentence = "My favorite subject is " + favoriteSubject + ".";
console.log(favoriteSubjectSentence);

--fcc-editable-region--

--fcc-editable-region--

--solutions--

js
console.log("Hi there!");
console.log("I am excited to talk to you.");

let bot;
let botLocation;

bot = "teacherBot";
botLocation = "the universe";

console.log("Allow me to introduce myself.");

const botIntroduction = "My name is " + bot + ".";
console.log(botIntroduction);

const botLocationSentence = "I live in " + botLocation + ".";
console.log(botLocationSentence);

bot = "professorBot";

const nicknameIntroduction = "My nickname is " + bot + ".";
console.log(nicknameIntroduction);

bot = "awesomeTeacherBot";

const newNicknameGreeting = "I love my nickname but I wish people would call me " + bot + ".";
console.log(newNicknameGreeting);

const favoriteSubject = "Computer Science";

const favoriteSubjectSentence = "My favorite subject is " + favoriteSubject + ".";
console.log(favoriteSubjectSentence);

console.log("Well, it was nice to talk to you. Have a nice day!");