calling an Async function synchronously
//return Boolean value
function SyncValue(){
var promise = new Promise((resolve, reject) => {
if(/* asynchronous code execution is successful */) {
return true;
} else {
return false;
}
return promise.then(returnValue =>{ return returnValue});
});
call function
if(SyncValue()){
//here do the logic
}
how I can lock the calling for the function to retrieve a value from "syncValue" function