JSFiddle - React, Tailwind, and code Playground

by Kishore Sahasranaman

JavaScript

var timer = 3;
setTimeout(excuteMethod, 1000);

function excuteMethod() {
  alert(timer+ ' call');
    timer--;
  if (timer >= 0) setTimeout(excuteMethod, 1000);
}