Last active
October 25, 2016 03:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exists = element => { | |
return document.querySelector(element) != null ? true : false; | |
} | |
export default exists; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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