juan_gandhi: (VP)
2015-01-27 04:40 pm

on the verge of introducing Y-combinator

isAncestor = function(ancestor) {
  var check = function(descendant) {
    var p = descendant && descendant.parentNode
    return ancestor === p || !!(p && check(p))
  };
  return check
}