Sha256: 01b64f63f3aba6ba003fd2ece4af4b65ccb06a4f64f872cbb5a16385c1c813a6

Contents?: true

Size: 730 Bytes

Versions: 277

Compression:

Stored size: 730 Bytes

Contents

var baseNth = require('./_baseNth'),
    baseRest = require('./_baseRest'),
    toInteger = require('./toInteger');

/**
 * Creates a function that gets the argument at index `n`. If `n` is negative,
 * the nth argument from the end is returned.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Util
 * @param {number} [n=0] The index of the argument to return.
 * @returns {Function} Returns the new pass-thru function.
 * @example
 *
 * var func = _.nthArg(1);
 * func('a', 'b', 'c', 'd');
 * // => 'b'
 *
 * var func = _.nthArg(-2);
 * func('a', 'b', 'c', 'd');
 * // => 'c'
 */
function nthArg(n) {
  n = toInteger(n);
  return baseRest(function(args) {
    return baseNth(args, n);
  });
}

module.exports = nthArg;

Version data entries

277 entries across 275 versions & 31 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/nthArg.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/nthArg.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.60 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.59 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.58 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.57 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.56 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.55 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.54 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.53 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.52 node_modules/lodash/nthArg.js
trusty-cms-6.3.1 node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.51 node_modules/lodash/nthArg.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/nthArg.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/nthArg.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/nthArg.js
immosquare-cleaner-0.1.50 node_modules/lodash/nthArg.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/nthArg.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/nthArg.js