Skip to content

Instantly share code, notes, and snippets.

@robinsmidsrod
Created June 15, 2009 13:15
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 robinsmidsrod/130108 to your computer and use it in GitHub Desktop.
Save robinsmidsrod/130108 to your computer and use it in GitHub Desktop.
not the right way to check type in javascript
if ( ! ( typeof el === 'object' && el instanceof HTMLElement ) ) {
throw new TypeError("Argument is not a DOM node");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment