JSFiddle - React, Tailwind, and code Playground
JavaScript
function mainFunc(){
var test = promiseFunc().then(function(result){
return result;
})
alert(test); // should be true value
return test;
}
function promiseFunc(){
return new Promise(function(resolve, reject){
alert(1);
resolve(true);
})
}
mainFunc();