Module 'random'
-
random()
Returns a random
Float
in the range 0.0 to 1.0
Example: random() //0.71189203412849
-
range(start,end)
Returns a random
Int
in the rangestart
toend
. ThrowsTypeError
ifstart
orend
is not anInt
Example:
range(1,10) //6
-
shuffle(array)
Shuffles
array
. ThrowsTypeError
if array is not anArray
Example:
let arr = [1,2,3,4,5] shuffle(arr) arr //[4,2,1,5,3]