0
Math.random and Math.floor is not working.
this will not work: var num = Math.floor(Math.random(50)) I am a kid learning JavaScript but is fluent in Lua. Please post the solution to this code. :P
3 Answers
+ 4
Math.random() will always return a number between 0 and 1, which you then floor down to 0. I guess technically it does work!
Just kidding, what you probably want to do is Math.floor(Math.random()*50);
0
I want a random number on anywhere between 50.
0
Your syntax must look like this:
Math.floor(Math.random ()*50)
Hope it helped!
---Carmelo