For example: a conventional random number
=. 3 NUM
const randomNum = the parseInt (Math.random () * (+ NUM . 1 )) // conventional random a number
RandomNum value will only be 0,123 in a random
If you want from a random array subscript index do not +1
, such as:
parseInt(Math.random()*(arr.length))