Answers for "how to check something is a promise"

0

js check if function is promise

console.log(prom instanceof Promise); // true
Posted by: Guest on October-15-2021
0

is promise

import isPromise from 'is-promise';

isPromise(Promise.resolve());//=>true
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
isPromise({then: true})//=>false
Posted by: Guest on April-30-2020

Code answers related to "how to check something is a promise"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language