how to resolve promise after value is returnes code example
Example: immediate promise resolve
Promise.resolve().then(() => {
console.log('resolved');
});
console.log('end');
// end
// resolve
Promise.resolve().then(() => {
console.log('resolved');
});
console.log('end');
// end
// resolve