check if obj is either an object or function.