Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does var/hoisting get in the way of that, or at least, that particular, construct?

FWIW, that would also be a nice "for" loop :-)

    var el
    for (
        el = document.getElement... ;
        el ;
        el = el.parentElement
    ) {
        // do something
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: