JSFiddle - React, Tailwind, and code Playground

JavaScript

//log the numbers 1 to 10 in the console with one second intervals without using a loop

var i = 0;

function loop(){
   setTimeout(function(){
   		console.log(i);
      i++;
      if (i <= 10){
      	loop();
      }
    }, 1000)
}

loop()