Skip to content

Promise.isPromise

Static method that checks whether a value is a thenable — that is, any object with a .then method.

Type TC39 CoreJS Babel Civet JS+
Polyfill Stage 2 View via Custom

Promise.isPromise(arg: any): arg is PromiseLike<any>

Section titled “Promise.isPromise(arg: any): arg is PromiseLike<any>”
Baseline logo Baseline
Chrome logo Edge logo
Firefox logo Zen logo
Safari logo
Node logo
Bun logo
Deno logo
Cloudflare Workers logo

Returns true if arg is a thenable. Because it follows Promises/A+, it returns true for any object or function with a .then method, not strictly native Promise instances.

The return type is a TypeScript type predicate, so the type of arg is automatically narrowed to PromiseLike<unknown> inside a truthy branch.

Promise.isPromise(Promise.resolve(1)); // → true
Promise.isPromise(fetch('/api/data')); // → true
Promise.isPromise({ then: () => {} }); // → true (thenable)
Promise.isPromise(null); // → false
Promise.isPromise(undefined); // → false
Promise.isPromise(42); // → false
Promise.isPromise({ then: 'not a fn' }); // → false