I wanted to share this link with you ;)

http://code.google.com/p/jslibs/wiki/JavascriptTips

Uh, no.

[quote]
var list = [1,2,3,4,5,6,7,8,9];

list = list.sort(function() Math.random() - 0.5);

Print(list); // prints something like: 4,3,1,2,9,5,6,7,8
[/quote]

This is the worst idea to shuffle an array. That was what Microsoft did in the first version of Browserchoice. See http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html

Some of the ideas are interesting, though. This one definitely is not.

Matt

--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to