Platinum Partner

Array Shuffle //JavaScript Function



[UPDATED CODE AND HELP CAN BE FOUND HERE]


usage


alert(shuffle([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));


code based on Fisher-Yates (never heard about him hahaha) algorithm


//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com/array/shuffle [v1.0]

shuffle = function(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}