Skip to content

Instantly share code, notes, and snippets.

@KhalilZaidoun
Created April 20, 2018 08:02
Show Gist options
  • Save KhalilZaidoun/38d9705b5f659ea79f9f86b517f7a571 to your computer and use it in GitHub Desktop.
Save KhalilZaidoun/38d9705b5f659ea79f9f86b517f7a571 to your computer and use it in GitHub Desktop.
Checks if the passed element is dom object or not
/**
* Checks if the passed element is dom object or not
* @param element
* @returns {boolean}
*/
function isDomElement(element) {
return element && typeof element === 'object' && 'nodeType' in element;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment