IT Fashion
A very private tech blog.
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
itfashion
View my complete profile
No comments:
Post a Comment