JSFiddle - React, Tailwind, and code Playground

by Miklos Nagy

JavaScript

function doSomething() {}

(function loop() {
    var rand = Math.round(Math.random() * (3000 - 500)) + 500;
    setTimeout(function() {
            alert('A');
            doSomething();
            loop();  
    }, rand);
}());