2015-11-03

JavaScript wuwu quiz

// quiz. figure out what does this code do
// 2015-10-29

function foo() {
    var eleName = document.getElementById("x79177");
    alert(
        (function(le) {
            return function(f) {
                return f(f);
            } (function(f) {
                return le(
                    function(x) { return (f(f))(x); }
                );
            });
        }) (function (givenGetDepth) {
            return function (element) {
                return (element === null) ? 0 : givenGetDepth(element.parentNode) + 1;
            };
        }) (document.getElementById(eleName))

    );
};
foo();