# JavaScript Random
● Math.random()
Math.random() returns a random number between 0 and 1.
● JavaScript Random integers
Math.random() used with Math.floor() can be used to return random integers.
● A Proper Random Function
As you can see from the examples above, It might be a good idea to create a proper random function to use for all random integer purposes.
This JSP function always returns a random number between min and max.
This JSP function always returns a random number between min and max.
No comments:
Post a Comment