dist/underscore-contrib.js
function(array, pred) {
      if (!isSeq(array)) throw new TypeError;

      var sz = _.size(array);

      for (var index = 0; index < sz; index++) {
        if(!truthy(pred(array[index]))) {
          break;
        }
      }

      return _.take(array, index);
    }
function(array, pred) {
      if (!isSeq(array)) throw new TypeError;

      var sz = _.size(array);

      for (var index = 0; index < sz; index++) {
        if(!truthy(pred(array[index]))) {
          break;
        }
      }

      return _.take(array, index);
    }
function ( array , pred ) { if ( ! isSeq ( array ) ) throw new TypeError ; var sz = _ . size ( array ) ; for ( var index = 0 ; index < sz ; index ++ ) { if ( ! truthy ( pred ( array [ index ] ) ) ) { break ; } } return _ . take ( array , index ) ; }
Takes all items in an array while a given predicate returns truthy.
Takes all items in an array while a given predicate returns truthy .