@singuerinc


2014-01-08 by Nahuel Scotti | 1 min read

Shuffle Javascript array

  • #array
  • #javascript

Este no es mío, pero es genial: ¿Cómo desordenar un array?

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