isPromiseLike
Checks if an object looks like a Promise.
- Check if the object is not
null, itstypeofmatches eitherobjectorfunctionand if it has a.thenproperty, which is also afunction.
Checks if an object looks like a Promise.
null, its typeof matches either object or function and if it has a .then property, which is also a function.