I brow some code in javascript, found some code of function like that
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
As what I say to the title, why this function use !!obj" ??