There is some library I use and it's function returns a promise.
function Something()
{
return new Promise((r,e) =>
{
r(true);
});
}
And I have my code:
//async function MyFunction() NO!
//function MyFunction(callback) NO!
function MyFunction() // -> BOOLEAN | void | undefined
{
return Something();
//return Something().then(/*actualy return*/).catch(/*return false or undefined*/);
//Something().Wait().ReturnResult();
}
console.log(MyFunction());
How do I return boolean value? Without making my function a promise.