Trying to convert an extended Array.prototype to a function
My advice is to use a known shuffle algorithm for this.  

This stackoverflow answer describes the Fisher-Yates shuffle and provides a function for you to use.

https://stackoverflow.com/a/2450976/423413

Bottom line use that function and replace your Array.prototype.shuffle function and call it something like shuffleArray

var shuffleArray = function(arr) {
    ...
}


Then replace the line that says randIndex.shuffle() with a call to the new function.

shuffleArray(randIndex);