Back to Freecodecamp

Step 8

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

latest1.5 KB
Original Source

--description--

The next message from the bot will concern the bot's location.

Create a variable called botLocationSentence.

Then use string concatenation with the + operator to join the string "I live in " with the botLocation variable followed by a period (.).

Assign this value to the botLocationSentence variable.

Then, log the value of botLocationSentence to the console.

--hints--

You should have a botLocationSentence variable.

js
assert.isNotNull(botLocationSentence);

Your botLocationSentence variable should hold the value of a string.

js
assert.isString(botLocationSentence);

You should use string concatenation with the + operator to join the string "I live in " with the botLocation variable followed by a period (.). Be mindful of spaces.

js
assert.equal(botLocationSentence, "I live in the universe.");

You should have a console statement in your code.

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

Your console statement should output the botLocationSentence variable.

js
assert.match(__helpers.removeJSComments(code), /console\.log\s*\(\s*botLocationSentence\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);

--fcc-editable-region--

--fcc-editable-region--