johnpaulada
3/10/2017 - 8:55 AM

Checks if all members of the collection (array) obeys the given condition (`check`). `check` should be a function that returns a boolean.

Checks if all members of the collection (array) obeys the given condition (check). check should be a function that returns a boolean.

const all = (collection, check) => collection.reduce((previous, current) => previous && check(current), true);