Back to Freecodecamp

Step 10

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

latest1.6 KB
Original Source

--description--

Now it is time to see the new bot value.

Start by creating a new variable called nicknameIntroduction.

Use string concatenation to join the string "My nickname is " with the bot variable followed by a period (.).

Assign the resulting string to the nicknameIntroduction variable.

Then, log the value of nicknameIntroduction to the console.

--hints--

You should have a variable called nicknameIntroduction.

js
assert.isNotNull(nicknameIntroduction);

Your nicknameIntroduction variable should be a string.

js
assert.isString(nicknameIntroduction);

You should use string concatenation to join the string "My nickname is " with the bot variable followed by a period (.). Be mindful of the spaces.

js
assert.strictEqual(nicknameIntroduction, "My nickname is professorBot.");

You should have a console statement in your code.

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

You should log the value of nicknameIntroduction to the console.

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

--fcc-editable-region--

--fcc-editable-region--