JSFiddle - React, Tailwind, and code Playground

HTML

<div id="log">


</div>

JavaScript

var a = function () {
    var timeout = 1000;

    let time_promise = new Promise((resolve, reject) => {
        let success = false;

        setTimeout(()=> {
        document.getElementById('log').appendChild(document.createTextNode("Called   "));
            resolve();
        }, timeout);
        });

    return time_promise;

};

var b = function() {
    a().then(()=>{
        //is the first b() released after this call?
        b();
    });
};

b();