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

Each predicate is a separate scope. How is the complexity additive? If you really have to you can simply be just as specific in your predicate naming as you would in a for loop.

    var authorsOfLongBooks = books
        .filter(book => book.pageCount > 1000)
        .map(longBooks => longBooks.author)
        .distinct()


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

Search: