dist/underscore-contrib.js
function unfoldWithReturn (seed, unaryFn) {
    var state = seed,
        pair,
        value;
    return function () {
      if (state != null) {
        pair = unaryFn.call(state, state);
        value = pair[1];
        state = value != null ? pair[0] : void 0;
        return value;
      }
      else return void 0;
    };
  }
function unfoldWithReturn (seed, unaryFn) {
    var state = seed,
        pair,
        value;
    return function () {
      if (state != null) {
        pair = unaryFn.call(state, state);
        value = pair[1];
        state = value != null ? pair[0] : void 0;
        return value;
      }
      else return void 0;
    };
  }
function unfoldWithReturn ( seed , unaryFn ) { var state = seed , pair , value ; return function ( ) { if ( state != null ) { pair = unaryFn . call ( state , state ) ; value = pair [ 1 ] ; state = value != null ? pair [ 0 ] : void 0 ; return value ; } else return void 0 ; } ; }
note that the unfoldWithReturn behaves differently than unfold with respect to the first value returned
note that the unfoldWithReturn behaves differently than unfold with respect to the first value returned