importbaseRestfrom'./_baseRest.js';importtoIntegerfrom'./toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */varFUNC_ERROR_TEXT='Expected a function'; /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */functionrest(func, start){if(typeof func !='function'){thrownewTypeError(FUNC_ERROR_TEXT);} start = start ===undefined? start :toInteger(start);returnbaseRest(func, start);} exportdefault rest;