code: function isAncestor(instA, instB) {
    while (instB) {
      if (instA === instB || instA === instB.alternate) {
        return true;
      }
      instB = getParent(instB);
    }
    return false;
  }
docs: Return if A is an ancestor of B.