JSFiddle - React, Tailwind, and code Playground
JavaScript
function onComplete(a) { // When the code completes, do this
document.body.innerHTML = a;
}
function getFive(whenDone) {
var a;
setTimeout(function () {
a = 5;
whenDone(a);
}, 10);
}
getFive(onComplete);