JSFiddle - React, Tailwind, and code Playground

by sabithpocker

JavaScript

function func(x,y,callback) {
    console.log(x,y);
   $("#block").addClass("class");
    setTimeout(function(){ 
         $("#block").removeClass("class");
         callback();
     },1000);
};

var params = [
    [1,2],
    [9,3],
    [6,4],
    [5,6]
], i = 0;

function fn() {
    if( params[i] ) {
        func( params[i][0], params[i++][1], fn );
    }
}

fn();