Crazy ,i already write 'console.log',but it told me wrong?

as i wrote the exercise :but it always tole me :slight_smile:

crazy me .
thank you for your help

Can’t argue that your code looks fine. I notice in the lesson text that Math.floor() is discussed. What happens if we include that in your expression?

console.log(Math.floor(Math.random() * 100))

P.S. I gave topic a vote because you included the link with your post. Thanks.

1 Like

the exercise ask me to write:
Inside of a console.log, create a random number with Math.random, then multiply it by 100.

If you run the program few times, you’ll see random numbers in the console.

i gave the answer:
but it always told me:
Did you write a console.log?
i do not know what wrong is it ?
you can look at again the picture above

As stated above, there is nothing I can see that is wrong with your code. If it is the SCT (Submission Correctness Test) then we can gain from knowing if the suggested code will pass. Try it and let us know what happens, please.

1 Like

i tried several times again right now

but it could not pass .

ok ,it works now .thanks

1 Like

Which solution passed?

console.log(Math.random() * 100);


console.log(Math.floor(Math.random() * 100));
1 Like

when i wrote the first line code ,it passed the first step.
before ,it could not pass the first step,
if i could not pass the first step. it can not arrive the second step code .

Okay, I understand. The suggested code was given in the second step. At least the first step finally let you move on. Best wishes the rest of the way through the track!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.