The functions Math.random()
and Math.floor
are shown above in the sample code to illustrate a random number generator for numbers in between 1 and 100. There are many other functions you can use in the Math Object that are documented online at your disposal. Make sure you always call the function using Math.someMethod()
, not just someMethod()
. You will not be able to use the functions in the Math Object without referencing it in your code. Play around with the random number generator below and try to print random numbers in between 50 to 100 instead of 1 to 100.