I randomize the order of my Array like that :
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 ? Thanks. Nicolas
Aucun commentaire:
Enregistrer un commentaire