JSFiddle - React, Tailwind, and code Playground
JavaScript
var foo = function() {
console.log(new Date().getTime());
};
(function(count) {
if (count < 5) {
foo();
var caller = arguments.callee;
window.setTimeout(function() {
caller(count + 1);
}, 1000);
}
})(0);