Now, it is time to generate a random number using the Math.random()
method.
Create a variable called randomNum
and assign it the value of the result of calling the Math.random()
method.
Then, log the randomNum
variable to the console.
Try adding a space in the code to re-run the bot and see different random numbers that are generated.
where am I ment to be adding the space? ( ) it still fails here
you should assign the result of calling the Math.random()
method to the randomNum
variable.
I just keep getting this error
Urgh JS makke my brain bad 
Please Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!
1 Like
Please post your full code and a link to the Step
Tell us what’s happening:
[quote=“iamthedump69, post:1, topic:741171, full:true”]
Now, it is time to generate a random number using the Math.random()
method.
Create a variable called randomNum
and assign it the value of the result of calling the Math.random()
method.
Then, log the randomNum
variable to the console.
Try adding a space in the code to re-run the bot and see different random numbers that are generated.
where am I ment to be adding the space? ( ) it still fails here
you should assign th
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 between 0 and less than 1.");
// User Editable Region
const randomNum = `Math.random()`;
console.log(randomNum);
// 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/134.0.0.0 Safari/537.36
Challenge Information:
Build a Mathbot - Step 3
You are not calling the function here. Look at the color of the text. What else is that color in your code?
1 Like