I have a conditional if
statement who's logic needs to be wrapped in a promise as the logic after if
can only be executed after it.
// WRAP 'if' statement below IN A PROMISE
if (a) { // could be true or false. If false, resolve the promise
// logic here
}
.then(
// execute logic after if here
)
I'm new to nodejs and am trying to wrap my head around this. How can I solve this ?