Build a Mathbot - Step 7

Tell us what’s happening:

let numRoundedDown = 6.7;
numRoundedDown=Math.floor(numRoundedDown);
console.log(numRoundedDown);
JS-Build a Mathbot-step7 - error:You should not hardcode the value of 6 for the numRoundedDown variable

Your code so far

const botName = "MathBot";
const greeting = `Hi there! My name is ${botName} and I am here to teach you about the Math object!`;

console.log(greeting);

console.log("The Math.random() method returns a pseudo random number greater than or equal to 0 and less than 1.");

const randomNum = Math.random();
console.log(randomNum);

console.log("Now, generate a random number between two values.");

const min = 1;
const max = 100;

const randomNum2 = Math.random() * (max - min) + min;
console.log(randomNum2);

console.log("The Math.floor() method rounds the value down to the nearest whole integer.");

// User Editable Region

let numRoundedDown = 6.7;
numRoundedDown=Math.floor(numRoundedDown);
console.log(numRoundedDown);

// 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 Mathbot - Step 7

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-mathbot/66eb3ec3b07dfe8f898646c0.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi there,

The instruction was to assign the result of rounding down 6.7 to the variable numRoundedDown. That’s not what you did.

Happy coding!