JSFiddle - React, Tailwind, and code Playground

by Claudius

HTML

<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>

CSS

li{width:50px;height:50px;margin:5px;background:#f00}

JavaScript

Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};
var testArray = [];
var randomArray = [];
$('li').hide();
$('li').each(function(i) {
    testArray[i] = i;
});
$('li').each(function(i) {
    var rndNo = Math.floor(Math.random() * testArray.length);
    randomArray[i] = testArray[rndNo];
    testArray.remove(rndNo);
})
$('li').each(function(i){
    $('li').eq(randomArray[i]).fadeIn(i*1000);  
});