How do you check an object is a promise or not

Posted by Jennifer | Updated on

If you don’t know if a value is a promise or not, wrapping the value as Promise.resolve(value) which returns a promise.

Another way is to check for .then() handler type


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers