1 var baseNth = require('./_baseNth'),
2 baseRest = require('./_baseRest'),
3 toInteger = require('./toInteger');
6 * Creates a function that gets the argument at index `n`. If `n` is negative,
7 * the nth argument from the end is returned.
13 * @param {number} [n=0] The index of the argument to return.
14 * @returns {Function} Returns the new pass-thru function.
17 * var func = _.nthArg(1);
18 * func('a', 'b', 'c', 'd');
21 * var func = _.nthArg(-2);
22 * func('a', 'b', 'c', 'd');
27 return baseRest(function(args) {
28 return baseNth(args, n);
32 module.exports = nthArg;