Skip to content

Instantly share code, notes, and snippets.

@marciobarrios
Created November 17, 2009 11:35
Show Gist options
  • Save marciobarrios/236846 to your computer and use it in GitHub Desktop.
Save marciobarrios/236846 to your computer and use it in GitHub Desktop.
detectar tipos de objetos
function isFunction(a) {
return typeof a == 'function';
}
function isNull(a) {
return typeof a == 'object' && !a;
}
function isNumber(a) {
return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
return (typeof a == 'object' && a) || isFunction(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment