Checks if all members of the collection (array) obeys the given condition (check). check should be a function that returns a boolean.
check
const all = (collection, check) => collection.reduce((previous, current) => previous && check(current), true);