Friday, November 11, 2016

javascript: Sorting an Array in Random Order

var points = [40, 100, 1, 5, 25, 10];
points.sort(function(a, b){return 0.5 - Math.random()}); 
 
 http://www.w3schools.com/js/js_array_sort.asp

No comments:

Post a Comment