JSFiddle - React, Tailwind, and code Playground
HTML
<div id="log"></div>
JavaScript
jQuery.get("/").then(first).then(second).then(third).then(fourth);
function first(data){
log("First function called: ",data.length);
return "String From First";
}
function second(data){
log("Second function called: ",data);
return jQuery.get("/");
}
function third(data){
log("Third function called: ",data.length);
return "String From Third";
}
function fourth(data){
log("Fourth function called: ",data);
}
function log(){
var div = $("<div></div>");
for(var i=0; i<arguments.length; i++){
div.append('<span>'+arguments[i]+'</span>');
}
$("#log").append(div);
}