Skip to content

Instantly share code, notes, and snippets.

@linkgod
Created January 14, 2014 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linkgod/8412866 to your computer and use it in GitHub Desktop.
Save linkgod/8412866 to your computer and use it in GitHub Desktop.
js类型判断
// type detect
utils.is = function(obj, type) {
return Object.prototype.toString.call(obj).slice(8, -1) === type;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment