1 year ago

#74316

test-img

Gaurav Agarwal

How to use a promisified function tha returns a bool as an if condition?

Is this the right way to use a function that returns a promise which resolves with either true or false inside an if condition?

if(functionName().then(function(data){return data})){
    //execute code
}

javascript

promise

0 Answers

Your Answer

Accepted video resources