Created
July 17, 2015 05:58
-
-
Save AndrewRayCode/0c86d5053baa58d638ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| hasParent( child, parent ) { | |
| let node = child.parentNode; | |
| while( node != null ) { | |
| if( node === parent ) { | |
| return true; | |
| } | |
| node = node.parentNode; | |
| } | |
| return false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment