JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/eu81273/jsfiddle-console/master/console.js"></script>
JavaScript
const promiseA = new Promise( ( resolve, reject ) => {
setTimeout( () => {
resolve( 'result of a()' );
}, 1000 ); // resolve after 1 second
} );
promiseA.then( ( data ) => {
console.log( 'promiseA succes:', data );
} ).finally( () => {
console.log('a() is done!');
} );