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

That code is ugly anyway, something I would have wrote in middle school... why not:

    function check(x) {
        return test1(x) && test2(x) && test3(x) && test4(x);
    }
Or, since I assume is JavaScript, just:

    const check = x => test1(x) && test2(x) && test3(x) && test4(x);


Nobody would actually write this, it's just a demonstration of the pattern at hand for the sake of discussion




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

Search: