Skip to content

Instantly share code, notes, and snippets.

@s4y
Created October 10, 2011 03:05
Show Gist options
  • Save s4y/1274551 to your computer and use it in GitHub Desktop.
Save s4y/1274551 to your computer and use it in GitHub Desktop.
isType: A mostly-naive implementation of, “Is this thing a Thing?”
function isType(object, type){
return object != null && type ? object.constructor.name === type.name : object === type;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment