Hi,
You could either try to shuffle the list (see crib sheet for JS implementation) then index the first element of the list.
Or you could try something like this Pavlovia: How to implement the range function? - #6 by Becca
Hope this helps,
Becca