/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function randomizeArray(array:Array):Array{ var newArray:Array = new Array(); while(array.length > 0){ newArray.push(array.splice(Math.floor(Math.random()*array.length), 1)); } return newArray; }