I'm stuck at Lesson 7 - (Libraries) Instruction 2


I would love your help with the issue I am having with the code below. I am doing something wrong but can’t figure out what. :slight_smile:


I am trying to figure out where to put the parentheses correctly. I believe that is what I am doing wrong but it might be something else.

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


The above will always be zero since you are flooring a float less than 1, which will then become 0. 0 times anything is zero.

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

Above we multiple the float by 100, and then floor it, giving us a possible range of 0…99.


Thank you for your response, mtf! I am still confused cause when I type in: console.log Math.floor(Math.random() * 100); and run it, it stills comes up wrong. What am I missing? Thank you!


Missing opening and closing parentheses on console.log().


Thank you so much, mtf for all your help! :smiley:


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