I have some code where I have an array of x amount of items. In this case, videos, and I want to randomly call a video, however if the current video already called is the sa
randojs.com makes this simple:
var sequence = randoSequence(videoLinks);
Then, you can loop through videoLinks to get the values in random order. Here's how you get the first random value:
sequence[0].value
When you run out, just generate a new sequence if needed.
You just need to add the following to the head of your html document, and you can do pretty much whatever you want with randomness easily. Random numbers, random values from arrays, random jquery elements, random properties from objects, and even preventing repetitions as I've shown here.