(For JavaScript and ActionScript 2)

To randomize an entire array:

To get a single random element:

function versions for the non-polluters…