javascript Check if an element is a descendant of another

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

Also in JavaScript: