I randomize the order of my array like this:
var arr = [ "A","B","C","D","E","F" ]
arr.sort(function() { return 0.5 - Math.random() });
// produces for example : [ C, E, A, F, D, B ]
But I don't want the "F" in fourth position (for example).
What is the solution ?
Aucun commentaire:
Enregistrer un commentaire