Check if an element is a descendant of another
JavaScript
const isDescendant = (child, parent) => parent.contains(child)
TypeScript
const isDescendant = (child: Node, parent: Node): boolean => parent.contains(child)
const isDescendant = (child, parent) => parent.contains(child)
const isDescendant = (child: Node, parent: Node): boolean => parent.contains(child)