JSFiddle - React, Tailwind, and code Playground

by Drath

JavaScript

thing = ["thingy", "thinger", "thang", "twang", "things"];

for (i=0;i<5;i++) {
    setTimeout("document.write(thing["+i+"])",1000)
}

for (i=0;i<5;i++){
    setTimeout(function(x){return function(){document.write(x)};}(thing[i]),1000);
}