Back to Freecodecamp

Step 1

curriculum/challenges/english/blocks/workshop-mathbot/66ea7adae8053065a64f9002.md

latest1.8 KB
Original Source

--description--

In this workshop, you will review working with the different Math object methods by building a Mathbot. This Mathbot will log some math operations and messages to the console in efforts to teach you about JavaScript's Math object.

For this first step, start by creating a variable called botName and assign it the string value of "MathBot".

Then, create another variable called greeting and assign it the sentence "Hi there! My name is [botName goes here] and I am here to teach you about the Math object!". In place of the [botName goes here] placeholder, use the botName variable.

You are free to use template literals or string concatenation with the + operator to achieve this.

Finally, log the greeting variable to the console.

--hints--

You should have a variable called botName.

js
assert.isNotNull(botName);

Your botName variable should be a string.

js
assert.isString(botName);

You should assign the string value "MathBot" to the botName variable.

js
assert.strictEqual(botName, "MathBot");

You should have a variable called greeting.

js
assert.isNotNull(greeting);

Your greeting variable should be a string.

js
assert.isString(greeting);

You should assign the following sentence to the greeting variable: "Hi there! My name is [MathBot goes here] and I am here to teach you about the Math object!". Make sure to replace [MathBot goes here] with the botName variable.

js
assert.strictEqual(greeting, "Hi there! My name is MathBot and I am here to teach you about the Math object!");

You should log the greeting variable to the console.

js
assert.match(code, /console\.log\(greeting\)/);

--seed--

--seed-contents--

js
--fcc-editable-region--

--fcc-editable-region--