Module 'random'
-
random()Returns a random
Floatin the range 0.0 to 1.0
Example: random() //0.71189203412849
-
range(start,end)Returns a random
Intin the rangestarttoend. ThrowsTypeErrorifstartorendis not anIntExample:
range(1,10) //6 -
shuffle(array)Shuffles
array. ThrowsTypeErrorif array is not anArrayExample:
let arr = [1,2,3,4,5] shuffle(arr) arr //[4,2,1,5,3]