Skip to content

Instantly share code, notes, and snippets.

@bugventure
Created April 29, 2015 10:47
Show Gist options
  • Save bugventure/6b208fb90cd255716a1a to your computer and use it in GitHub Desktop.
Save bugventure/6b208fb90cd255716a1a to your computer and use it in GitHub Desktop.
function type(obj) {
var str = Object.prototype.toString.call(obj);
return str.substr(8, str.length - 9).toLowerCase();
}
function isInteger(obj) {
return (obj | 0) === obj; // jshint ignore: line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment