This is my array: arr = [0, 1, 2, 3, 4, 5]
I want to randomly iterate through it the first time and then iterate through it in the same (random) order each time after that. How would I do it? The only way I can think of would be to shuffle the arr, using something like this shuffle function and then iterate through sequentially. For example:
newArr = shuffle(arr);
for(j = 0; j <5; j++) {
for(i = 0; i < newArr.length; i++)
}
I am wondering if there is an easier, inline way, so that if items get appended to the array I do not have to reshuffle (and make a new array
each time)