GitHub 6521★

Check if an element is a descendant of another

JavaScript version

const isDescendant = (child, parent) => parent.contains(child);

TypeScript version

const isDescendant = (child: Node, parent: Node): boolean => parent.contains(child);
Follow me on and to get more useful contents.