Skip to content

Instantly share code, notes, and snippets.

@GreenGeorge
Last active October 25, 2016 03:38
Show Gist options
  • Save GreenGeorge/a9a7cf7efcd6ff77904ec7d8399fd28b to your computer and use it in GitHub Desktop.
Save GreenGeorge/a9a7cf7efcd6ff77904ec7d8399fd28b to your computer and use it in GitHub Desktop.
Helper function to determine if an element exists or not in the dom
const exists = element => {
return document.querySelector(element) != null ? true : false;
}
export default exists;
{
"name": "exists",
"description": "Helper function for verifying DOM existence",
"version": "1.0.0",
"main": "exists.js",
"private": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment