JSFiddle - React, Tailwind, and code Playground
HTML
<input value="abc">
JavaScript
$(document).ready(function() {
console.log("Running the program");
async function foo() {
let a = 0;
for (let i = 0; i < 1000000000; i++) {
a += Math.random() > 0.5 ? 1 : -1;
}
console.log("I am running at Point A of the async function");
return a;
}
foo().then((v) => {
console.log("finally I get the value from the async function, and it is ", v);
});
console.log("This is after calling the async function");
});