can.isPromise
Check if an object is a Promise.
can.isPromise(subject)
Parameters
-
subject
{*}
The object to check.
Returns
{Boolean}
Whether subject is a Promise.
Check if an object is a Promise.
{*}
The object to check.
{Boolean}
Whether subject is a Promise.
can.isPromise
returns if an object has the methods expected of a Promise object.Example
Convert any value to a Promise: