I want to run a function that each time randomly chooses an element from an array that wasn't chosen before. And if all elements were chosen, I want to reset the used elements and start from the beginning.
Hope this makes sense.
I already have a function that chooses a random element from an array. But I also don't want it to choose elements that were chosen before unless all elements were already chosen.
Here is what I have got so far (credit to @Kelly):
var item = items[Math.floor(Math.random() * items.length)]