I have a function that takes a single argument. I need to be able to tell if this argument is a jQuery Promise or Deferred object. If not, then the val
Promise
Deferred
The quick-and-dirty solution is to test if the object has a then function:
then
if (typeof message.then === 'function') { //assume it's a Deferred or fits the Deferred interface } else { //do other stuff }