1 var apply = require(
'./_apply');
4 var nativeMax = Math.max;
15 function overRest(func, start, transform) {
16 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
20 length = nativeMax(args.length - start, 0),
21 array = Array(length);
23 while (++index < length) {
24 array[index] = args[start + index];
27 var otherArgs = Array(start + 1);
28 while (++index < start) {
29 otherArgs[index] = args[index];
31 otherArgs[start] = transform(array);
32 return apply(func,
this, otherArgs);
36 module.exports = overRest;