Last active
October 6, 2015 14:00
-
-
Save 50percentgrey/c986afb16781ea0f6a4b to your computer and use it in GitHub Desktop.
Simple Array Custom Sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomArray(item1, item2):Number{ | |
return Math.floor((Math.random()*2)-(Math.random())); | |
} | |
// usage // a is your array | |
var b:Array = a.sort(randomArray); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment