JSFiddle - React, Tailwind, and code Playground
by joplomacedo
JavaScript
function x( ) {
return new Promise( (res, rej) => {
setTimeout( () => {
res();
}, 3000)
});
}
async function y() {
await x();
alert('done');
}
y();
by joplomacedo
function x( ) {
return new Promise( (res, rej) => {
setTimeout( () => {
res();
}, 3000)
});
}
async function y() {
await x();
alert('done');
}
y();