4 ms·
You don't even have to resolve the promise via a callback for that to be the case - you can use the static resolve method. This is really useful if you have a f
by jallardice 11y ago
You don't even have to resolve the promise via a callback for that to be the case - you can use the static resolve method. This is really useful if you have a function that can sometimes return a promise and sometimes a "normal" value.
Promise.resolve("resolved!").then(result => console.log(result));
console.log("next statement");