Another option for shuffling a JavaScript array is passing a shuffle function into the native .sort() method.numbers.sort(shuffle); function shuffle () {return Math.round(Math.random()) - 0.5;}Here is a post to a discussion on Fisher-Yates vs the above bubble sort approach.http://stackoverflow.com/questions/962802/is-it-correct-to-use-javascript-array-sort-method-for-shuffling