code: function getAllAncestors(el) {
    var ancestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
    var nextAncestor = el.parentNode;
  
    if (!nextAncestor) {
      return ancestors;
    }
  
    ancestors.push(nextAncestor);
    return getAllAncestors(nextAncestor, ancestors);
  }
docs: recursive function to get all ancestor nodes of given element