You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
193 B

4 years ago
  1. 'use strict';
  2. module.exports = function every(array, predicate) {
  3. for (var i = 0; i < array.length; i += 1) {
  4. if (!predicate(array[i], i, array)) {
  5. return false;
  6. }
  7. }
  8. return true;
  9. };