-
-
Save madrobby/333764 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// pure JS | |
function shuffle(array) { | |
return array.sort(function(){ | |
return .5 - Math.random(); | |
}); | |
} | |
// with Prototype.js you can do | |
function shuffle(array){ | |
return array.sortBy(Math.random); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eccajune: Mind being more specific? I'm looking to shuffle a jPlayer Video Playlist but I don't know at what hook to insert this code. Thank you for your help.