Skip to content

Instantly share code, notes, and snippets.

@bga
Created September 28, 2010 17:46
Show Gist options
  • Select an option

  • Save bga/601429 to your computer and use it in GitHub Desktop.

Select an option

Save bga/601429 to your computer and use it in GitHub Desktop.
// known issues:
// 1) not cross frame (_fn.toString === Function.prototype.toString)
var _isFunction = function(_fn)
{
return typeof(_fn) == 'function' ||
(
typeof(_fn) != 'string' &&
!(_fn instanceof String) &&
String(_fn).replace(/^\s+/, '').slice(0, 8) == 'function' &&
(
!('toString' in _fn) ||
_fn.toString === Function.prototype.toString
)
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment