JSFiddle - React, Tailwind, and code Playground
by ric47121
JavaScript
for(i=0;i<3;i++){
(function(i){
var pos = i;
var timer = setInterval(function(){
console.log("toto",pos++)
if(pos==5){
console.info("eliminando el timer", i)
clearInterval(timer)
}
},1000);
})(i);
}